1// Genereates a number between 0 to 1;
2Math.random();
3
4// to gerate a randome rounded number between 1 to 10;
5var theRandomNumber = Math.floor(Math.random() * 10) + 1;
1function getRandomNumberBetween(min,max){
2 return Math.floor(Math.random()*(max-min+1)+min);
3}
4
5//usage example: getRandomNumberBetween(20,400);
6
1//returns a random number between min and max
2
3const randomNumbers = (min, max) => {
4 return Math.round(Math.random() * (max - min)) + min;
5}