Created
July 29, 2011 10:17
-
-
Save craigmdennis/1113572 to your computer and use it in GitHub Desktop.
Simple random array object
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
var myArray = ["Good!", "Great!", "Awesome!", "Super!", "Nice!"]; | |
function random(array) { | |
return array[Math.floor(Math.random() * array.length)]; | |
} | |
random(myArray); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment