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