For example I would like to generate 5 unique numbers between 1 & 10. The results should be 5 numbers from 1 to 10(for example 2 3 4 8 10).
Another method is to produce random numbers and only add them to the returning array if it does not already include them.
function randomRange(from, to, leng){
var tem, A= [], L= 0, i= 0;
randomRangeLoop:
while(L< leng){
tem= Math.floor(Math.random()*to)+from;
i= 0;
while(i
alert(randomRange(1, 10, 5))
/* returned value: (Array) 8,6,1,3,5 */