Skip to content

Instantly share code, notes, and snippets.

@AWaselnuk
Created January 26, 2015 21:35
Show Gist options
  • Save AWaselnuk/85e797e7c44df6d7c3d0 to your computer and use it in GitHub Desktop.
Save AWaselnuk/85e797e7c44df6d7c3d0 to your computer and use it in GitHub Desktop.
Get a random integer between min and max
// Returns a random integer between min (included) and max (excluded)
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