Skip to content

Instantly share code, notes, and snippets.

@pietrom
Created September 8, 2016 13:50
Show Gist options
  • Save pietrom/5a0ca748a94d585072d0494576cd34a9 to your computer and use it in GitHub Desktop.
Save pietrom/5a0ca748a94d585072d0494576cd34a9 to your computer and use it in GitHub Desktop.
function randomInt(from, to) {
var interval = to - from + 1;
return function() {
return Math.floor(Math.random() * interval) + from;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment