I've got two lists. When I run array1 == array2
, the console prints false
. If I iterate through them and check equality for each item, it prints true
every time. What's wrong?
for (var i=0; i<array1.length; i++) {
console.log(array1[i] == array2[i]);
}
From the Safari console:
All my google searches turned up things about array diffs and checking equality of unordered arrays. I thought there must be an easier way to solve the problem of two lists in the same order, and I couldn't find that online.