This question already has an answer here:
var items = Array(523,3452,334,31,...5346);
How do I get random item from items
?
This question already has an answer here:
var items = Array(523,3452,334,31,...5346);
How do I get random item from items
?
Use underscore (or loDash :)):
Or to shuffle an entire array:
jQuery is JavaScript! It's just a JavaScript framework. So to find a random item, just use plain old JavaScript, for example,
Shorter:
Here's yet another way: