Why does table[0][0] = 2 not only assign that value to the first item in the first array?
let table = new Array(3).fill(Array(3));
table[0][0] = 2;
console.log(table);
output: [ [ 2, , ], [ 2, , ], [ 2, , ] ]
Why does table[0][0] = 2 not only assign that value to the first item in the first array?
let table = new Array(3).fill(Array(3));
table[0][0] = 2;
console.log(table);
output: [ [ 2, , ], [ 2, , ], [ 2, , ] ]