Created
April 30, 2020 21:20
-
-
Save matgargano/c6f06827e99cfe7b1acb2348a5739ad1 to your computer and use it in GitHub Desktop.
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
/** | |
* | |
* Returns a random element from an array | |
* | |
*/ | |
function random_item(items) { | |
return items[Math.floor(Math.random()*items.length)]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment