Friday, 12 March 2010

Initializing Multi-dimensional array in Javascript

Initializing 2-D array in Javascript

// Arrays within arrays:

var x = new Array(new Array(1,2,3),new Array('A','B','C'),new Array('x','y','z'));

alert(x[1][2]); // returns 'C'

No comments:

Post a Comment