This is a Javascript / jQuery question:
I\'m trying to generate six unique random numbers between 1 and 21 (no duplicates), using the jQuery.inArray
// Initial number var x = Math.ceil(Math.random() * TotalLogos); // Keep searching until a unique number is found while ($.inArray(x, r) > -1) { x = Math.ceil(Math.random() * TotalLogos); } // If it's unique, set it r[t] = x;