JavaScript - 随机获取数组元素
var myArray = ['one', 'two', 'three', 'four', 'five']; var rand = Math.floor(Math.random() * myArray.length); var rValue = myArray[rand]; console.log(rValue)
要发表评论,您必须先登录。