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

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

var arr = ["太阳光大","成功是优点的发挥","不要小看自己", "口说好话","手心向下是助人" ];
alert(arr[Math.floor((Math.random()*arr.length))]);

猜你喜欢

转载自blog.csdn.net/chb19991118/article/details/121486623