js多维数组

版权声明:内容多为自言自语,请自行判断有无价值。 https://blog.csdn.net/weixin_41702247/article/details/82806420
let three = [];
for(let i=0;i<4;i++){
    three[i]=[];   //令数组three的元素也是数组,下同
    for(let j=0;j<3;j++){
        three[i][j]=[];
        for(let k=0;k<2;k++){
            three[i][j][k]=k;
        }
    }
}
console.log(three);

猜你喜欢

转载自blog.csdn.net/weixin_41702247/article/details/82806420
今日推荐