1

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, ,  ] ]
Not A Bot
  • 2,474
  • 2
  • 16
  • 33

0 Answers0