Skip to content

Instantly share code, notes, and snippets.

@EvanHahn
Created August 12, 2012 07:42
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 EvanHahn/3330517 to your computer and use it in GitHub Desktop.
Save EvanHahn/3330517 to your computer and use it in GitHub Desktop.
JavaScript sleepsort
// JavaScript sleepsort
// by Evan Hahn (evanhahn.com)
// Port of this genius on 4chan:
// http://dis.4chan.org/read/prog/1295544154
// Call it like this:
// sleepsort(5, 4, 12, 8, 9, 10, 240);
function sleepsort() {
var i = arguments.length;
while (i --) {
setTimeout(function(n) {
console.log(n);
}, i, arguments[i]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment