Created
July 7, 2015 12:16
-
-
Save ptiswitz/c8eb33c2090ba3c078d3 to your computer and use it in GitHub Desktop.
Function to make a random selection between two values
This file contains 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 randomBetween(val1, val2) { | |
return Math.round(Math.random()) ? val1 : val2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You will like this gist : https://gist.github.com/spyesx/bb1742fe863c0b8a0191 ;)