Created
August 30, 2021 09:59
-
-
Save hmmhmmhm/6924afc3d67294730c1611eca95f8be5 to your computer and use it in GitHub Desktop.
How to create a random number that can be scoped briefly
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
| // ~~(min + Math.random() * max) | |
| // 0 ~ 100 | |
| ~~(Math.random() * 100) | |
| // 1 ~ 5 | |
| ~~(1 + Math.random() * 5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment