Created
October 28, 2017 10:31
-
-
Save tex2e/60e7c42f5dea0561eae914d821368d0f to your computer and use it in GitHub Desktop.
random number in 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
function rand(min, max) { | |
if (max === undefined) { max = min; min = 0; } | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment