Skip to content

Instantly share code, notes, and snippets.

@queviva
Last active January 31, 2022 22:16
Show Gist options
  • Save queviva/629160665d3563003614b43fba6f9551 to your computer and use it in GitHub Desktop.
Save queviva/629160665d3563003614b43fba6f9551 to your computer and use it in GitHub Desktop.
returns a random integer between two other values
const randIntBetween = (x, y) => ~~(Math.random() * (x - y) ) + x
@queviva
Copy link
Author

queviva commented Jan 31, 2022

called by passing two values, the lower value, x, and the the higher value, y

they have to be passed-in in that order

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment