var data = new Array();
data starts off as a regular one-dimensional array. A two dimensional array is really just an array of arrays. So you could do something like
for (var i = 0; i
Alternatively you could use the following approach
for (var i = 0; i
In any case, at some point you are going to need a loop to populate your initial array with sub-arrays to get the 2d effect.