Created
January 26, 2015 21:35
-
-
Save AWaselnuk/85e797e7c44df6d7c3d0 to your computer and use it in GitHub Desktop.
Get a random integer between min and max
This file contains hidden or 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
// Returns a random integer between min (included) and max (excluded) | |
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