UNPKG

@phaserjs/phaser

Version:
10 lines (9 loc) 226 B
export function Shuffle(array) { for (let i = array.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); const temp = array[i]; array[i] = array[j]; array[j] = temp; } return array; }