define empty 2d array javascript 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]