Created
July 23, 2015 12:05
-
-
Save Razenbull/2bce1434f8b9c205bb64 to your computer and use it in GitHub Desktop.
Get a random int within a specified range
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* @param min (inclusive) | |
* @param max (exclusive) | |
* @returns {*} | |
*/ | |
function getRandomInt(min, max) { | |
return Math.floor(Math.random() * (max - min)) + min; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment