Skip to content

Instantly share code, notes, and snippets.

@libersolis-dev
Created January 3, 2018 20:46
Show Gist options
  • Save libersolis-dev/19bb5b06e993887d38fa9bb23f3dca10 to your computer and use it in GitHub Desktop.
Save libersolis-dev/19bb5b06e993887d38fa9bb23f3dca10 to your computer and use it in GitHub Desktop.
JS recipe to generate random whole numbers in a specific range
function generateRandomInteger(min, max) {
return Math.floor((Math.random() * max) + min);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment