Created
May 23, 2017 15:14
-
-
Save thomasxbanks/bfd15ab5c3bfce224fba108e44d06d8a 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
| let random_number = (min, max) => { | |
| return ~~(Math.floor(Math.random() * max) + min) | |
| } | |
| // USAGE | |
| // array[random_number(0, array.length)] | |
| // if (random_number(0, 3) >= 2) { | |
| // // do foo | |
| // } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment