the problem I have is when I associate value in the 2d array on a certain row and column, that value will be stored on several rows on the same column
var Matrix = Array(3).fill(Array(3).fill(0));
console.log(Matrix);
Matrix[1][2]=1;
console.log(Matrix);
and the output is :
/// the 2d array
[ [ 0, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ]
/// after 'Matrix[1][2]=1'
[ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ]