How to push values to a multi-dimensional array
<p>I can't figure out how to push values to a dynamic multi-dimensional array. This is the code i have:</p>

<pre><code>function compareNumbers(){
    var count = $('.finishedRow').length;
    var inputtedNums = new Array();
    for(var i=0; i&lt;count; i++){
        $('.finishedRow').eq(i).find('li').each(function(j){
            inputtedNums[i].push($(this).text());
        });
    }
    console.log(inputtedNums);
}
</code></pre>

<p>So say there are, for example, 3 <code>finishedRow</code> selectors and each <code>finishedRow</code> selector contains 4 <code>li</code> elements with values of <code>first</code>, <code>second</code>, <code>third</code>, <code>fourth</code>. I want my <code>inputtedNums</code> variable to look like:</p>

<pre><code>inputtedNums = [
   ["first", "second", "third", "fourth"],
   ["first", "second", "third", "fourth"], 
   ["first", "second", "third", "fourth"] 
]
</code></pre>

<p>As my code is now I get the error: <code>Cannot call method 'push' of undefined</code>.</p>

<p>I'm sure I'm missing something fundamental here.</p>
