Skip to content

Instantly share code, notes, and snippets.

@cdmz
Created January 26, 2016 01:28
Show Gist options
  • Save cdmz/95a41dbc10146843a454 to your computer and use it in GitHub Desktop.
Save cdmz/95a41dbc10146843a454 to your computer and use it in GitHub Desktop.
get random item javascript
var arr = [25,477,244,5872,145,8,778,2,21,4];
var random = arr[Math.floor(Math.random() * arr.length)];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment