Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javscript generate empty 2d array

var grid = [...Array(width)].map(e => Array(height));
// access via grid[y][x]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javscript #generate #empty #array
ADD COMMENT
Topic
Name
8+4 =