CombSort implementation on javascript.
See: https://en.wikipedia.org/wiki/Comb_sort
Install:
npm i comb-sort
or
yarn add comb-sort
Basic usage:
const data = some...dataconst sortedData =
(This is mutable operation and it will change source array)
or
const sortedData =
You can pass a custom compare function as the second argument:
const customCompare = { if Array && Array && firstchildrenlength > secondchildrenlength return true return false}const sortedData =
Also, you can pass custom reduction value as the third argument.
const sortedData =
Be careful with playing with reduction parameter.
It can affect performance and accuracy.