JS get random number between
snippet in javascript

JS get random number between

user3959

function getRandomNumberBetween(min,max){
    return Math.floor(Math.random()*(max-min+1)+min);
}

//usage example: getRandomNumberBetween(20,400); 

javascript random number between 0 and 10

user1309

Math.floor(Math.random() * 10);

random int javascript

user3760

//Returns random Int between 0 and 2 (included)
Math.floor(Math.random()*3)

javascript generate random number

user5052

Math.random();