I'm trying to create a JavaScript card game and want to pick 5 cards without repetition:
var colors = ["hearts", "spades", "diamonds", "clubs" ];
var values = ["2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"];
color = colors[parseInt(Math.random()*colors.length,10)]
value = values[parseInt(Math.random()*values.length,10)]
How can I make sure that there is no repetition if I pick 5 cards?