Skip to content

Instantly share code, notes, and snippets.

@hpieroni
Last active January 5, 2022 19:30
Show Gist options
  • Save hpieroni/93b2669f1f652cda458cb01e9e0c6fd7 to your computer and use it in GitHub Desktop.
Save hpieroni/93b2669f1f652cda458cb01e9e0c6fd7 to your computer and use it in GitHub Desktop.
Returns an integer random number between min (included) and max (included):
function randomBetween(min, max) {
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