js math random number between code example
Example 1: javascript random
function random(min, max) {
return ~~(Math.random() * (max - min + 1) + min);
}
random(1, 5);
Example 2: random number in js
Math.random() returns a random number in [0,1)