Skip to content

Instantly share code, notes, and snippets.

@kerryChen95
Created April 20, 2013 16:37
Show Gist options
  • Save kerryChen95/5426556 to your computer and use it in GitHub Desktop.
Save kerryChen95/5426556 to your computer and use it in GitHub Desktop.
Untitled
function shuffle (source) {
return source.slice().sort(function (a, b) {
return Math.random() < 0.5 ? -1 : 1;
});
}
var arr = Array.apply(null, new Array(3 * 54))
.map(function (val, i) { return i; });
console.log( shuffle(arr) );
{"view":"split-vertical","fontsize":"110","seethrough":"","prefixfree":"1","page":"javascript"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment