random object in js code example
Example 1: javascript get random number
// Returns a number between min and max
function getRandomArbitrary(min, max) {
return Math.random() * (max - min) + min;
}
Example 2: how to create a random number generator in javascript
console.log(Math.floor(Math.random() * 10))