problem building matrix through use of a loop
<p>This is my code:</p>

<pre><code>var shuffle = function() {
    var set = [];
    var waiter = [];
    var suitset = ["Hearts","Clubs","Diamonds","Spades"];
    for (var r = 1;r &lt;= 13;r++) {
        for (var s = 0;s &lt; suitset.length;s++) {
            card = [];
            var cardeval = evalcard(r); //This is an input from another function
            card.push(cardeval[0]);
            card.push(suitset[s]);
            card.push(cardeval[1]);
            waiter.push(card);
        }
    }
    while (waiter.length) { //This is what randomizes the deck aka shuffles
        set.push(waiter.splice(Math.random() * waiter.length,1));
    }

    return set;
};
</code></pre>

<p>I'm trying to build a matrix of cards (I'm using matrix here as an array of arrays). There will be 52 arrays of card arrays, each of which holds a card number, suit, and value. But after I call the function, <code>card</code> returns as a string and not an array, even though it is defined with array brackers <code>[]</code>. Can anyone see what I'm doing wrong here?</p>
