Skip to content

Instantly share code, notes, and snippets.

@e7h4n
Created May 5, 2014 16:07
Show Gist options
  • Save e7h4n/11540913 to your computer and use it in GitHub Desktop.
Save e7h4n/11540913 to your computer and use it in GitHub Desktop.
function qs(arr) {
if (!arr || !arr.length) {
return [];
}
var split = arr.pop();
return qs(arr.filter(function (item) { return item <= split; }))
.concat([split])
.concat(qs(arr.filter(function (item) { return item > split; })));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment