How can I create a two dimensional array in JavaScript?

后端 未结 30 4286
天涯浪人
天涯浪人 2020-11-21 05:25

I have been reading online and some places say it isn\'t possible, some say it is and then give an example and others refute the example, etc.

  1. How do I dec

30条回答
  •  野的像风
    2020-11-21 05:38

    I'm not sure if anyone has answered this but I found this worked for me pretty well -

    var array = [[,],[,]]
    

    eg:

    var a = [[1,2],[3,4]]
    

    For a 2 dimensional array, for instance.

提交回复
热议问题