quicksorter
A quicksort implementation.
Usage
Import quicksort with your choice of module system:
// orlet qsort = // CommonJS// or // AMD
then use it:
let arr = 3816530console// output:// [0,1,3,3,5,6,8]
Provide a "predicate" function to specify how to compare any two items a and b of the array being sorted. The predicate function must return -1 if a < b, 0 if a == b, and 1 if a > b:
let arr2 = first: 'Alicia' last: 'Kemper' first: 'Lesya' last: 'Urakova' first: 'Ron' last: 'Allen' first: 'Idris' last: 'Montego' console// output: first: 'Ron' last: 'Allen' first: 'Alicia' last: 'Kemper' first: 'Idris' last: 'Montego' first: 'Lesya' last: 'Urakova'