Created
December 4, 2019 14:23
-
-
Save wwwmarcos/b006e3faa74b8bfe33ad2ee0fd8b4a1f to your computer and use it in GitHub Desktop.
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 getRandom (items) { | |
return items[Math.floor(Math.random()*items.length)] | |
} | |
const fruits = ['uva', 'laranja', 'batata'] | |
getRandom(fruits) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good, public utility!