Building a MultiDimensional Array in Javascript

Building a MultiDimensional Array in Javascript The MultiDimensional Array
is zero based.  In the following example the array range is [0..6][0..1].


var sDataArray=MultiDimensionalArray(7,2);
function MultiDimensionalArray(iRows,iCols)
var i;
var j;
   var a = new Array(iRows);
   for (i=0; i < iRows; i++)
       a[i] = new Array(iCols);
       for (j=0; j < iCols; j++)
           a[i][j] = "";

You might also like...


David Nishimoto NishiSoft provides Part I of the Information Technology Project collaboration. Sign up and list your IT project tasks, assign task too friends, and get percent complete task. Part will include a wo...


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Debuggers don't remove bugs. They only show them in slow motion.”