📅  最后修改于: 2022-03-11 15:02:43.653000             🧑  作者: Mango
function randomFunc(names) {
for (let i = 0; i < 2; i++) {
const random = names[Math.floor(Math.random() * names.length)];
return random
}
}
const names = ["Abir", "Arham", "Sadi", "Labi", "Mahdi"]
console.log(randomFunc(names));