function randomNumber(min, max) { return Math.floor(Math.random() * (max - min)) + min; }
// Returns a number between min and max function getRandomArbitrary(min, max) { return Math.random() * (max - min) + min; }
//Write the following code to get a random number between 0 and n Math.floor(Math.random() * n);
Math.random();
// Returns an integer between min and max (the maximum is exclusive and the minimum is inclusive) function getRandomInt(min, max) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min) + min); }
var randomNo = Math.floor(Math.rand() * 10000000001); console.log(randomNo); //This will generate random number
Math.random()