📅  最后修改于: 2022-03-11 15:04:19.351000             🧑  作者: Mango
// using array and random example
function getTheBill() {
let names = ["bob", "mike", "matt"];
let randomFriend = Math.floor(Math.random() * names.length);
let randomFriendBuyng = names[randomFriend];
return randomFriendBuyng + " is buying us lunch today!";
}