jQuery Multidimensional Array (dynamic key) - Cannot set property of undefined

后端 未结 2 1119
时光说笑
时光说笑 2021-01-22 01:15

Thanks you Chad for his solution, however it now appears to clear values from the array, here is a foreach on the console log which shows you my situation (followed

2条回答
  •  自闭症患者
    2021-01-22 02:01

    Try as below and let me know

    var a = new Array();
    a[0]= new Array();
    a[0].push(1);
    a[0].push(2);
    a[0].push(3);
    
    console.log(a[0][0]);
    console.log(a[0][1]);
    console.log(a[0][2]);

提交回复
热议问题