var Arr = ["a","b","c","d","e","f"];
var n = Math.floor(Math.random() * Arr.length + 1)-1;
alert(Arr[n]);
数组中随机选取一个元素
最新推荐文章于 2023-02-16 20:19:09 发布
var Arr = ["a","b","c","d","e","f"];
var n = Math.floor(Math.random() * Arr.length + 1)-1;
alert(Arr[n]);