generate random number id javascript code example
Example 1: generate random number javascript
function randomNumber(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
Example 2: Random number generation in javascript generate random number using javascript js
const random = Math.floor(Math.random() * 20);
console.log(random);
// 12