1// this will create a 2D array of 'none' word
2var size = 3;
3var myArray = Array(size).fill( Array(size).fill("none") );
4
5console.log(myArray);
6/*
7[
8 ["none", "none", "none"],
9 ["none", "none", "none"],
10 ["none", "none", "none"]
11]
12*/
1// declaration of a two-dimensional array
2// 5 is the number of rows and 4 is the number of columns.
3const matrix = new Array(5).fill(0).map(() => new Array(4).fill(0));
4
5console.log(matrix[0][0]); // 0
6