var arr = ["元素0", "元素1"]; var index = Math.floor(Math.random() * arr.length + 1) - 1; console.log('随机数组元素'+arr[index]);
本文标题:随机数组元素(案例)
本文链接:https://www.haomeiwen.com/subject/zbkjbctx.html
网友评论