Javascript: Random element from array
Function to get a random element from a Javascript array.
function rand_elem(items) {
var item = items[Math.floor(Math.random() * items.length)];
return item;
}
Function to get a random element from a Javascript array.
function rand_elem(items) {
var item = items[Math.floor(Math.random() * items.length)];
return item;
}