Skip to content

Instantly share code, notes, and snippets.

@psycalc
Last active July 20, 2016 16:30
Show Gist options
  • Save psycalc/9f82ee5ebc43b6243b4fd665555ea314 to your computer and use it in GitHub Desktop.
Save psycalc/9f82ee5ebc43b6243b4fd665555ea314 to your computer and use it in GitHub Desktop.
JavaScript random integer range expression, function randomInt
//main formula Math.floor(Math.random() * (max - min + 1)) + min;
function randomInt(min,max) {
return Math.floor(Math.random() * (max - min + min)) + min;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment