var shuffleArray = function(array) { var currentIndex = array.length; var temporary; var toIndex; while (currentIndex) { toIndex = Math.floor(Math.random() * currentIndex--); temporary = array[currentIndex]; array[currentIndex] = array[toIndex]; array[toIndex] = temporary; } return array; }
时间: 2024-10-28 08:17:34