js数组中随机选取一个数值!!

var arr = ["a","b","c", "d","e", "f", "g"];
console.log(arr[Math.floor((Math.random()*arr.length))]);

效果图:

 

posted @ 2021-05-19 15:35  web_cnblogs  阅读(99)  评论(0)    收藏  举报