Created
July 5, 2018 19:20
-
-
Save 1-800-jono/ddfda6f7efc4ce27e921f7ade68928b8 to your computer and use it in GitHub Desktop.
Get random item from array in JS
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
nameArray = ['Mike', 'Tom', 'Jose']; | |
randomArrayItem = Math.floor(Math.random() * nameArray.length); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment