I know the syntax for a 1 dimensional array..
var myArray = new Array();
But what is the syntax for a 2 or 3 dimensional array?
Also.. what is the syntax for making a number into a string?
say for example,
alert(myArray[0] (as String)); ...or something like that...
Syntax for a multi-dimensional array?
Moderator: Paul Tuersley
- lloydalvarez
- Enhancement master
- Posts: 460
- Joined: June 17th, 2004, 9:27 am
- Location: New York City, NY
- Contact:
If you mean an array that holds arrays you could define it like this:But what is the syntax for a 2 or 3 dimensional array?
Code: Select all
var myArray = [new Array(),new Array()];
Code: Select all
var myArray = [[0,0],[1,1]];
Also.. what is the syntax for making a number into a string
Code: Select all
var myNum = 100;
var myStr = myNum.toString();
-Lloyd