Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript create matrix

// this will create a 2D array of 'none' word
var size = 3;
var myArray = Array(size).fill( Array(size).fill("none") );

console.log(myArray);
/*
[
	["none", "none", "none"],
	["none", "none", "none"],
	["none", "none", "none"]
]
*/
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #create #matrix
ADD COMMENT
Topic
Name
4+3 =