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.

“Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves” - Alan Kay