js declare empty 2d array code example
Example: javscript generate empty 2d array
var grid = [...Array(width)].map(e => Array(height));
// access via grid[y][x]
var grid = [...Array(width)].map(e => Array(height));
// access via grid[y][x]