Skip to content

Instantly share code, notes, and snippets.

@tex2e
Created October 28, 2017 10:31
Show Gist options
  • Save tex2e/60e7c42f5dea0561eae914d821368d0f to your computer and use it in GitHub Desktop.
Save tex2e/60e7c42f5dea0561eae914d821368d0f to your computer and use it in GitHub Desktop.
random number in range
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