Cara membandingkan elemen dalam array

for (let i = 0; i < a.length; i++) {
    for (let k = i + 1; k < a.length; k++) {
        if (a[i] != a[k]) {
            //do stuff
        }
    }
}
Defeated Dragonfly