Answers for "matrix array javascript"

1

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"]
]
*/
Posted by: Guest on June-15-2021
12

js array two dimensional

// declaration of a two-dimensional array
// 5 is the number of rows and 4 is the number of columns.
const matrix = new Array(5).fill(0).map(() => new Array(4).fill(0));

console.log(matrix[0][0]); // 0
Posted by: Guest on May-24-2020
0

matrix array javascript

1
2
3
4
5
Posted by: Guest on May-14-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language