js 数组中随机取一个值

let status = [0,1,2]
let sj = status[Math.floor(Math.random()*status.length)];
console.log('随机的值', sj)
posted @ 2022-07-12 11:01  慕雪琳鸢  阅读(807)  评论(0)    收藏  举报