random 2 digit number javascript code example
Example 1: javascript random no between 2 numbers
function randomIntFromInterval(min, max) {
return Math.floor(Math.random() * (max - min + 1) + min);
}
Example 2: javascript random number between
Math.floor(Math.random() * 6) + 1
Example 3: javascript get a random number with 6 digits
Math.floor(100000 + Math.random() * 900000);
Example 4: randint js
const Math.randint => (min,max) {
[min,max] = (max===undefined)?[0,min]:(min>max)[max,min]:[min,max];
return Math.floor(Math.random*(max-min)+min);
}