Skip to content

Instantly share code, notes, and snippets.

@SimonAKing
Created October 10, 2020 05:12
Show Gist options
  • Save SimonAKing/ed28d18fa8ac23f31c0edf6f24e6c7f0 to your computer and use it in GitHub Desktop.
Save SimonAKing/ed28d18fa8ac23f31c0edf6f24e6c7f0 to your computer and use it in GitHub Desktop.
QuickSort.js
const quickSort = a => {
if (!a.length) { return [] }
return [
...quickSort(a.filter(e => e < a[0])),
...a.filter(e => e === a[0]),
...quickSort(a.filter(e => e > a[0]))]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment