Skip to content

Instantly share code, notes, and snippets.

@paulownia
Created July 25, 2019 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulownia/4dfddd872c9924c2275c5614707e95ea to your computer and use it in GitHub Desktop.
Save paulownia/4dfddd872c9924c2275c5614707e95ea to your computer and use it in GitHub Desktop.
function shuffle(arr) {
for (let i = arr.length; i > 1;) {
const j = Math.floor(Math.random() * i);
i--;
const ie = arr[i];
arr[i] = arr[j];
arr[j] = ie;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment