Skip to content

Instantly share code, notes, and snippets.

@wgminer
Created October 3, 2014 16:41
Show Gist options
  • Save wgminer/550f57159157ff129f25 to your computer and use it in GitHub Desktop.
Save wgminer/550f57159157ff129f25 to your computer and use it in GitHub Desktop.
Random object selector
function randomArrayElement(array) {
var i = Math.floor(Math.random() * array.length);
return array[i];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment