标签:
function shuffle(arr){ var len = arr.length; for(var i = 0;i<len -1;i++) { var idx = Math.floor(Math.random() * (len - 1)); var temp = arr[idx]; arr[idx] = arr[len - i - 1]; arr[len - i - 1] = temp; } return arr; }
标签:
原文地址:http://www.cnblogs.com/CyLee/p/5964520.html