I have two arrays (representing a deck of cards), one filled with the values 1-52, and another filled with nothing. I want to take the position randomly from the first array and take that object and put it into the next spot available in the randomized array. I have this so far:
var shufdeck = new Array();
while(sufdeck.length < 52)
{
i = Math.floor(Math.random()*52);
//shufdeck[0] = deck[i] etc.
}
I'm not sure if I should be using splice or something else to take it out of the first array and put it into the second. If possible shufdeck[] should be filled and deck[] would be empty.