Last active
March 7, 2017 08:25
-
-
Save toddzebert/b4465de41b0f8d317d7a685604983c36 to your computer and use it in GitHub Desktop.
a helper utility that returns a random integer; see https://gist.github.com/toddzebert/cee6d8b0475275be0f48d7dfef142bd3
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
function randInt (spread, base) { | |
return Math.floor(Math.random() * spread + (isNaN(base) ? 0: base)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment