Nested loops

var j = 0, i = 0;
for(i; i < firstArray.length; i++){
	while(j < firstArray.length){
 		if(i != j) {
			console.log(j + " against " + i);
		}
		j++;
	}
  j = 0;
}

Add your comment