Nodejs Array Random Item Get getRandomItem(items)

Here you can find the source of getRandomItem(items)

Method Source Code

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

Related

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