let fruits = ["Apple", "Banana", "Mango", "Orange"]; // array let index = Math.floor(Math.random() * fruits.length); // random index console.log(fruits[index]); // result
var item = items[Math.floor(Math.random()*items.length)];