Skip to content

Instantly share code, notes, and snippets.

@callmecavs
Created April 6, 2017 18:23
Show Gist options
  • Save callmecavs/9204d13855c8508d5c0c5eb99af2e5a1 to your computer and use it in GitHub Desktop.
Save callmecavs/9204d13855c8508d5c0c5eb99af2e5a1 to your computer and use it in GitHub Desktop.
random number between 2 integers (inclusive)
// generates a random integer between min & max bounds, inclusive
const randBetween = (min, max) => {
return Math.floor(Math.random() * (max - min + 1) + min)
}
export default randBetween
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment