Answers for "how to compare elements in an array"

0

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
        }
    }
}
Posted by: Guest on November-03-2020

Code answers related to "how to compare elements in an array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language