随机排序

            // 随机排序
            var foo = function (arr) {
                var cloneArr = arr.concat();
                var len = cloneArr.length;
                for (var i=0;i<len;i++){
                    var index = Math.floor(Math.random() * cloneArr.length);
                    var temp = cloneArr[index];
                    cloneArr[index] = cloneArr[i];
                    cloneArr[i] = temp;
                }
                return cloneArr;
            };
栏目
每日精选