JavaScript数组随机排序函数

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

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

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


你可能感兴趣的:(JavaScript,function)