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
1let x = [
2 [1, 2, 3],
3 [4, 5, 6],
4 [7, 8, 9]
5];
6console.log(items[0][0]); // 1
7console.log(items[0][1]); // 2
8console.log(items[1][0]); // 4
9console.log(items[1][1]); // 5
10console.log(items);