Why does this happen? If you execute this code you will see what is printed in the comments. I had assumed that A1, A2 and A3 would all be the same things.
const A1 = Array(3).fill([]);
const A2 = [[], [], []];
const A3 = [];
for (let index = 0; index < 3; index++) {
A3.push([]);
}
console.log(A1 == A2 || A1 == A3 || A2 == A3); // False
In fact, A1 in particular is doing really weird things as highlighted below.
A1[0].push(5);
console.log(A1); // [ [ 5 ], [ 5 ], [ 5 ] ]
A2[0].push(5);
console.log(A2); // [ [ 5 ], [], [] ]
A3[0].push(5);
console.log(A3); // [ [ 5 ], [], [] ]