📜  随机数组 javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:44.389000             🧑  作者: Mango

代码示例6
const months = ["January", "February", "March", "April", "May", "June", "July"];

const random = Math.floor(Math.random() * months.length);
console.log(random, months[random]);