JavaScript数组随机排序函数

来源:互联网 发布:网络管理是做什么 编辑:程序博客网 时间:2024/05/29 03:36

参考:http://www.codebit.cn/javascript/javascript-array-shuffle.html

           http://snippets.dzone.com/posts/show/849

var shuffle = function(o){ //v1.0for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);return o;};


原创粉丝点击