Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bidimensional array

Status
Not open for further replies.

jazzmaster111

Programmer
May 2, 2005
25
MX
How can I create a bidimensional array?
I need this array has unlimited items

Thanks!!
 
Like this:

Code:
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
	}
}

Hope this helps,
Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top