comparing all elements with each other in a array code example
Example: how to compare elements in an 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
}
}
}