Created
August 1, 2018 16:39
-
-
Save jportella93/56e45862fa5d276a4666fa36ca679eb8 to your computer and use it in GitHub Desktop.
Javascript random number between two numbers
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
// 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