Created
May 31, 2023 03:41
-
-
Save neysidev/d4601be8e55d2537b00d31b72713bc89 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // https://stackoverflow.com/questions/4959975/generate-random-number-between-two-numbers-in-javascript | |
| function randomIntFromInterval(min, max) { // min and max included | |
| return Math.floor(Math.random() * (max - min + 1) + min) | |
| } | |
| const rndInt = randomIntFromInterval(1, 6) | |
| console.log(rndInt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment