Guest User

Untitled

a guest
Nov 24th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. /**
  2. * Shuffles array in place.
  3. * @param {Array} a items An array containing the items.
  4. */
  5. function shuffle(a) {
  6. var j, x, i;
  7. for (i = a.length - 1; i > 0; i--) {
  8. j = Math.floor(Math.random() * (i + 1));
  9. x = a[i];
  10. a[i] = a[j];
  11. a[j] = x;
  12. }
  13. }
Add Comment
Please, Sign In to add comment