1var nums = [1,2,3,4,5,6,7,8,9,10],//all numbers to be randomized
2 ranNums = [],
3 i = nums.length,
4 j = 0;
5
6while (i--) {
7 j = Math.floor(Math.random() * (i+1));
8 ranNums.push(nums[j]);
9 nums.splice(j,1);
10}
11ranNums.next().value; //To use afterwards (for each time that the numbers are used)