Skip to content

Instantly share code, notes, and snippets.

@obrenoco
Created January 28, 2022 17:08
Show Gist options
  • Save obrenoco/04dc07a42caf6c63ade214496819e2ef to your computer and use it in GitHub Desktop.
Save obrenoco/04dc07a42caf6c63ade214496819e2ef to your computer and use it in GitHub Desktop.
function shuffle(array) {
var m = array.length, t, i;
while (m) {
i = Math.floor(Math.random() * m--);
t = array[m];
array[m] = array[i];
array[i] = t;
}
return array;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment