javascript how to generate a random integer code example
Example 1: generate random integer javascript
var randomnumber = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
Example 2: generate random int js
function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min;
}