/ Published in: JavaScript
Expand |
Embed | Plain Text
// Returns a random number between min and max function getRandom(min, max) { return Math.random() * (max - min) + min; } // Returns a random integer between min and max // Using Math.round() will give you a non-uniform distribution! function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }
You need to login to post a comment.
