Last active
January 31, 2022 22:16
-
-
Save queviva/629160665d3563003614b43fba6f9551 to your computer and use it in GitHub Desktop.
returns a random integer between two other values
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
const randIntBetween = (x, y) => ~~(Math.random() * (x - y) ) + x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
called by passing two values, the lower value, x, and the the higher value, y
they have to be passed-in in that order