#qsort
Quicksort using es6 features:
- parameter destructuring with rest operator
- array comprehension and spreading
| const qsort = ([first, ...rest]) => | |
| first === undefined | |
| ? [] | |
| : [ | |
| ...qsort([for (x of rest) if (x < first) x]), | |
| first, | |
| ...qsort([for (x of rest) if (x >= first) x]) | |
| ] |
#qsort
Quicksort using es6 features: