Javscript generiert leeres 2D -Array
var grid = [...Array(width)].map(e => Array(height));
// access via grid[y][x]
just-saved-you-a-stackoverflow-visit
var grid = [...Array(width)].map(e => Array(height));
// access via grid[y][x]
var value = 'foo'; // by default
var myGrid = [...Array(6)].map(e => Array(6).fill(value));