for (let i = 0; i < a.length; i++) { for (let k = i + 1; k < a.length; k++) { if (a[i] != a[k]) { //do stuff } } }
var array1 = [4,8,9,10]; var array2 = [4,8,9,10];