choose random number js code example
Example 1: generate random number javascript
function randomNumber(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
Example 2: generate number using math random in javascript
console.log(Math.round(Math.random() * 10))