📜  创建多维数组 javascript for 循环 - Javascript 代码示例

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

代码示例1
var squares = new Array();
for(var i = 0; i <= 8; i++)
{
    squares[i] = new Array();
    for(var j = (i * 20) + 1; j <= 20 * i + 20; j++)
        if (squares[i] == null)
            squares[i] = j;
        else
            squares[i].push(j);
}