javascript multi dimensional dynamic array
<p>I could use some guidance on specifying a dynamic multi dimensional array in javascript. I understand that javascript does not natively define multi dim arrays, but rather an array of an array, ie.</p>

<pre><code> var items = [[1,2],[3,4],[5,6]];
</code></pre>

<p>or</p>

<pre><code> var array = [[,],[,]]
</code></pre>

<p>or</p>

<pre><code> var a = [[1,2],[3,4]]
</code></pre>

<p>My issue is that I do not know the actual dimensions, and simply defining the array, as in the second example above, still does not allow for the array to go beyond two record sets. I thought there was a REDIM stmt similar to VB but have not been able to locate anything.</p>

<p>One additional part of my problem is that when I specify the second dimension of the array, as in the example below, the array becomes unreachable outside of the for block.</p>

<pre><code>var Exforsys=new Array(4)
for (i=0; i &lt;4; i++) {
   Exforsys[i]=new Array(4)
}
</code></pre>

<p>I am trying to retrieve data from my specific array like this...</p>

<pre><code> function newTest() {
        var myArray = [[],[]];
      //  myArray[] = new Array(14);

        var recCount = coordsAry.length / 15;
        var n =0;

        var i = 0;
        var s = 0;

        for (i = 0; i &lt; recCount; i++) {
            for (s = 0; s &lt; 15; s++) {
              //  myArray[i] = new Array(14);

                myArray[i][s] = coordsAry[n];
                n++;

              //  alert("i=" + i + " s=" + s + " Val: " + (myArray[i][s]));

            }
            // var u = 4;
            s = 0;

            alert(myArray[0][3]);
            alert(myArray[0][4]);

            alert("i=" + i + " s=" + s + " Val: " + (myArray[i][s]));              

        }
</code></pre>

<p>coordsAry has 105 records and is flat, {"12","Frank","564", ... etc} this has been proven. After the 2nd record is populated I get this error....</p>

<pre><code>Error: Unable to set value of the property '0': object is null or undefined.
</code></pre>

<p>Obviously, my javascript skills are a bit rough to say the least. Any sample code would be greatly appreciated.</p>

<p>Thanks,</p>
