Skip to content

Instantly share code, notes, and snippets.

@craigmdennis
Created July 29, 2011 10:17
Show Gist options
  • Save craigmdennis/1113572 to your computer and use it in GitHub Desktop.
Save craigmdennis/1113572 to your computer and use it in GitHub Desktop.
Simple random array object
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