从JavaScript数组中获取随机项目

詹姆士 :
var items = Array(523,3452,334,31,...5346);

如何获得随机物品items

凯莉:
var item = items[Math.floor(Math.random() * items.length)];

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章