javascript multi dimensional dynamic array

前端 未结 3 1994
清酒与你
清酒与你 2020-12-15 23:22

I could use some guidance on specifying a dynamic multi dimensional array in javascript. I understand that javascript does not natively define multi dim arrays, but rather a

3条回答
  •  再見小時候
    2020-12-15 23:50

    To add an element to an array you can use push(val) (to add the back of the array) or unshift(val) to add to the front of the array. So:

    var Exforsys=[];
    for (i=0; i <4; i++) {
       Exforsys.push([]);
    }
    

提交回复
热议问题