Skip to content

Instantly share code, notes, and snippets.

@photonstorm
Created April 3, 2013 11:49
Show Gist options
  • Select an option

  • Save photonstorm/5300530 to your computer and use it in GitHub Desktop.

Select an option

Save photonstorm/5300530 to your computer and use it in GitHub Desktop.

Revisions

  1. photonstorm created this gist Apr 3, 2013.
    12 changes: 12 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    function shuffleArray(array) {

    for (var i = array.length - 1; i > 0; i--) {
    var j = Math.floor(Math.random() * (i + 1));
    var temp = array[i];
    array[i] = array[j];
    array[j] = temp;
    }

    return array;

    }