javascript random number 1-10 code example
Example 1: javascript random
function random(min, max) {
return ~~(Math.random() * (max - min + 1) + min);
}
random(1, 5);
Example 2: javascript generate random number
Math.random();
function random(min, max) {
return ~~(Math.random() * (max - min + 1) + min);
}
random(1, 5);
Math.random();