js怎样将几个 元素 随机放入数组

如题所述

调用array的push方法,参数是random的

push(array.splice(Math.floor(Math.random()*array.length),1))
温馨提示:答案为网友推荐,仅供参考
相似回答