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)];
//This is an example of a Temporal Literal
lunchParty = ["Angela", "Ben", "Jenny", "Michael", "Chloe"];
function whosPaying(names) {
let upperBound = names.length;
let PersonBuyingLunch = Math.floor(Math.random() * upperBound)
return names[PersonBuyingLunch]
}
//below are backticks, not single quotes
alert(`${whosPaying(lunchParty)} is buying lunch today`)
whosePaying(lunchParty)