I want to use a 3x3 two-dimensional array to store data. However, when I assign 1 to g[1][1], I found the output strange - the whole second col was assigned to 1!
let g = new Array(3).fill( // 3 x 3
        new Array(3).fill(0)
    );
console.log(g);
g[1][1] = 1;
console.log(g);
this code outputs:
[ [ 0, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ]
[ [ 0, 1, 0 ], [ 0, 1, 0 ], [ 0, 1, 0 ] ]
I upgraded my node to v9.11.1, and this issue remain unsolved. 
My system is MacOS High Sierra 10.13.6.
I want to ask:
- What is the right way to create and initiate a multidimension array?
- What is the right way to assign values to multidimension array elements?
Thanks.


