compare a array value with all the values in 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
}
}
}