Last active
October 13, 2022 22:07
-
-
Save agamm/80ae48dd3ee0fc5bbec5 to your computer and use it in GitHub Desktop.
Javascript random choice picker.
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 makemychoice() { | |
args = Array.prototype.slice.call(arguments); | |
return ( args[~~(args.length * Math.random())] ) + " was chosen."; | |
} | |
// Example: makemychoice("Go to run", "Go to swim", "Fix bug"); | |
// from the creator of unzip.dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment