Just a quick brief regarding arrays. Since an Array can store other Arrays you can get the benefit of multi-dimension arrays.
var x=[0,1,2,3,4,5]; var y=[x];
In the above example i've created an array named "x" and assigned it as the first element in the array "y". If we ask for the value of y[0] it will return the contents of "x" as a string because we didn't specify an index.
var x=[0,1,2,3,4,5]; var y=[x]; document.writeln(y[0]); // Will output: 0,1,2,3,4,5
If we wanted the third index we'd access it this way...
var x=[0,1,2,3,4,5]; var y=[x]; document.writeln(y[0][3]); // Will output: 2
There's no defined limit to how many Arrays you can nest in this manner. For instance...
document.writeln(bigArray[5][8][12][1])
...would indicate bigArray's 5th index held an array, who's 8th index held an array, who's 12th index held an array, who's first index contains the data we want.