You can create a 6 x 6 empty array like this:
var myGrid = [...Array(6)].map(e => Array(6));
Array(6)generates an array with length = 6 and full ofundefinedvalues.- We map that array to another array full of
undefinedvalues. - In the end, we get a 6×6 grid full of
undefinedpositions.
If you need to initialize the grid with a default value:
var value="foo"; // by default
var myGrid = [...Array(6)].map(e => Array(6).fill(value));
Now you have a 6 x 6 grid full of 'foo'.