Skip to content

Instantly share code, notes, and snippets.

@jportella93
Created August 1, 2018 16:39
Show Gist options
  • Save jportella93/56e45862fa5d276a4666fa36ca679eb8 to your computer and use it in GitHub Desktop.
Save jportella93/56e45862fa5d276a4666fa36ca679eb8 to your computer and use it in GitHub Desktop.
Javascript random number between two numbers
// If you wanted to get between 1 and 6, you would calculate:
Math.floor(Math.random() * 6) + 1
// 1 is the start number
// 6 is the number of possible results (1 + start (6) - end (1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment