jazzmaster111
Programmer
How can I create a bidimensional array?
I need this array has unlimited items
Thanks!!
I need this array has unlimited items
Thanks!!
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
var xDimensions = 5;
var yDimensions = 5;
var someArray = [];
for (var xLoop=0; xLoop<xDimensions; xLoop++) {
someArray[xLoop] = [];
for (var yLoop=0; yLoop<yDimensions; yLoop++) {
someArray[xLoop][yLoop] = 1; // final value for someArray[x][y] goes here
}
}