Nodejs Utililty Methods Array Random Item Get

List of utility methods to do Array Random Item Get

Description

The list of methods to do Array Random Item Get are organized into topic(s).

Method

getRandom(items)
function getRandom(items) {
    var item = items[Math.floor(Math.random() * items.length)];
    return item;
getRandomItem(items)
var getRandomItem = function(items){
  return items[Math.floor(Math.random()*items.length)];