Last active
July 20, 2016 16:30
-
-
Save psycalc/9f82ee5ebc43b6243b4fd665555ea314 to your computer and use it in GitHub Desktop.
JavaScript random integer range expression, function randomInt
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
//main formula Math.floor(Math.random() * (max - min + 1)) + min; | |
function randomInt(min,max) { | |
return Math.floor(Math.random() * (max - min + min)) + min; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment