Skip to content

Instantly share code, notes, and snippets.

@Razenbull
Created July 23, 2015 12:05
Show Gist options
  • Save Razenbull/2bce1434f8b9c205bb64 to your computer and use it in GitHub Desktop.
Save Razenbull/2bce1434f8b9c205bb64 to your computer and use it in GitHub Desktop.
Get a random int within a specified range
/**
*
* @param min (inclusive)
* @param max (exclusive)
* @returns {*}
*/
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