1var items = ['Yes', 'No', 'Maybe'];
2var item = items[Math.floor(Math.random() * items.length)];
1var colors = ["red","blue","green","yellow"];
2var randomColor = colors[Math.floor(Math.random()*colors.length)]; //pluck a random color
3
1var myArray = [
2 "Apples",
3 "Bananas",
4 "Pears"
5];
6
7var randomItem = myArray[Math.floor(Math.random()*myArray.length)];
1 const arr = myArray
2 .map((a) => ({sort: Math.random(), value: a}))
3 .sort((a, b) => a.sort - b.sort)
4 .map((a) => a.value)