Creating a multidimensional array in javascript
<p>I am aware that javascript does not allow true multidimensional arrays but you can sort of "bodge" one together by having arrays within arrays.</p>

<p>I have 2 questions;</p>

<p>1) Would converting 10 arrays into 1 multidimensional array which has 10 arrays within it improve, damage or have no effect on the performance of the webpage?</p>

<p>2) I am hoping to create an array that has 100 elements, each of these will be an array of 2 elements and finally each of these will be an array of indeterminate length.</p>

<p>I have the following code to create this "multidimensional" array:</p>

<pre><code>var RouteArray = new Array(100);
for (var i=0; i &lt;100; i++)
{
RouteArray[i]=new Array(2);
    for (var j=0; j &lt;2; j++)
    {
    RouteArray[i][j] = new Array();
    }
}
</code></pre>

<p>Is this code sensible? or would you experienced coders be able to suggest a better method?</p>

<p>Also I assume that I could then add to the indeterminate arrays in the multidimensional array described above with the following code:</p>

<pre><code>RouteArray[88][0].push(ValueToPush);
</code></pre>

<p>finally could I then call the value I have just pushed using the following?</p>

<pre><code>Var ValueAdded = RouteArray[88][0][0];
</code></pre>

<p>Thanks in advance for your time, and apologies if this question has been answered elsewhere, I did try to search but either couldn't understand the previous posts or found them to be so unlike my situation that I couldn't apply what they suggested.</p>

<p>John</p>
