Created
April 12, 2019 10:36
-
-
Save mohnatus/819ece9d5548fa673e3c1eecfe4c467e to your computer and use it in GitHub Desktop.
get random integer
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 (включительно) и max (не включая max) | |
| // Использование метода Math.round() даст вам неравномерное распределение! | |
| function getRandomInt(min, max) { | |
| return Math.floor(Math.random() * (max - min)) + min; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment