📌  相关文章
📜  Javascript 从数组中获取随机项 - Javascript 代码示例

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

代码示例1
var colors = ["red","blue","green","yellow"];
var randomColor = colors[Math.floor(Math.random()*colors.length)]; //pluck a random color