Skip to content

Instantly share code, notes, and snippets.

@Tomotoes
Created October 10, 2020 05:12
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 Tomotoes/ed28d18fa8ac23f31c0edf6f24e6c7f0 to your computer and use it in GitHub Desktop.
Save Tomotoes/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