📜  javascript 创建矩阵 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:10.461000             🧑  作者: Mango

代码示例1
// 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"]
]
*/