Skip to content

Instantly share code, notes, and snippets.

View pixeloution's full-sized avatar

Erik Wurzer pixeloution

  • Apple
  • Austin, TX
View GitHub Profile
@pixeloution
pixeloution / shuffle.js
Created August 13, 2018 15:01
Fisher-Yates Shuffle
function shuffle(a) {
var j, x, i;
for (i = a.length - 1; i > 0; i--) {
j = Math.floor(Math.random() * (i + 1));
x = a[i];
a[i] = a[j];
a[j] = x;
}
return a;
}