javascript tutorial - [Solved-5 Solutions] create a two dimensional array in JavaScript - javascript - java script - javascript array
Problem:
How can I create a two dimensional array in JavaScript?
Solution 1:
Solution 2:
Solution 3:
Solution 4:
The following function can be used to construct a 2-d array of fixed dimensions:
- The number of columns is not really important, because it is not required to specify the size of an array before using it.
- Then we can just call: