Last active
October 4, 2015 21:38
-
-
Save jcutrell/2703859 to your computer and use it in GitHub Desktop.
Unique Random Number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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