genrate random number javascript code example
Example 1: generate random number javascript
function randomNumber(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
Example 2: generate random number javascript
// generates random float between 0-1
Math.random()