Skip to content

Instantly share code, notes, and snippets.

@jcutrell
Last active October 4, 2015 21:38
Show Gist options
  • Save jcutrell/2703859 to your computer and use it in GitHub Desktop.
Save jcutrell/2703859 to your computer and use it in GitHub Desktop.
Unique Random Number
function uniqRand(notThis, range){
var maybe = Math.floor(Math.random() * range);
if (maybe !== notThis){
return maybe;
} else {
return uniqRand(notThis, range);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment