I have not found an answer to the simplest case possible. I know there are lots of questions like that but all of them have a higher degree of complexity. In my case, the arrays are very similar in the following respects:
- the same number of elements
- all the elements are of the same kind,
- the elements consist only of integers 0 and 1
The code I have is:
var mearr = [
[1, 1, 0, 1, 1, 0],
[1, 1, 1, 0, 1, 0],
[1, 1, 1, 0, 0, 1],
[0, 1, 0, 0, 1, 1],
[1, 1, 1, 0, 1, 0],
[1, 0, 0, 1, 0, 1]
];
for (i=0;i<mearr.length/2;i++) {
var l = mearr[i];
var r = mearr[i+3];
var same = (l == r) ? "Same" : "different";
console.log(l, r, same);
}
I'd assume that the second and fifth elements would return "Same", but they do not.