Javscript génère un tableau 2D vide
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));