advice on how to compare the exact order and contents of multiple arrays
<p>At the moment I'm trying to compare the contents of 2 arrays using the for..in loop but with no success. I'm familiar with how to get the contents of each array separately but not sure how to then match each of these contents up. Basically if 2 values in the same index values of the array don't match I want to return false else carry on. My latest attempt I've tried placing both arrays in the same for..in using different variables then comparing these. If anyone could advise on this that would be great.</p>

<p>JS</p>

<pre><code>var list1 = [1, 2, 3, 4, 5, 6];
var list2 = [1, 2, 3, 4, 5, 'e'];

var i, j;
for (i in list1 &amp;&amp; j in list2) {

    if (list1[i] !== list2[j]) {
        return false
    } else {
        return true
    }
}

/*for ( j in list2 ) {
console.log( list2[j] )        
}*/​
</code></pre>
