JavaScript Array
<p>According to a tutorial I am reading, if you want to create a table with 5 columns and 3 rows to represent data like this...</p>

<pre><code>45 4  34 99 56
3  23 99 43 2
1  1  0  43 67
</code></pre>

<p>...it says that you can use the following array</p>

<pre><code>var table = new Array(5)

table[0] = [45, 4, 34, 99, 56];
table[1] = [3, 23, 99, 43, 2];
table[2] = [1, 1, 0, 43, 67];
</code></pre>

<p>But I would have expected it to be like this</p>

<pre><code>var table = new Array(3)
table[0] = [45, 4, 34, 99, 56];
table[1] = [3, 23, 99, 43, 2];
table[2] = [1, 1, 0 43, 67]
</code></pre>

<p>If, as in the tutorial, <code>var table</code> is initially declared as an array with 5 elements, and then the first (table[0]), second (table[1]) and third (table[2]) are filled with the data, what happens with the other two elements that were initially set in the array with new Array(5). Why do you need to use 5? </p>
