function shuffle(array) { let length = array.length; let index; let temp; while (length > 0) { index = Math.floor(Math.random() * length); temp = array[length - 1]; array[length - 1] = array[index]; array[index] = temp; length--; } return array }
'运行