An in-place stable array sort, because Array#sort()
is not guaranteed stable.
This is an implementation of merge sort, without recursion.
Function based on the Two-Screen/stable sort 0.1.8 from https://github.com/Two-Screen/stable
name | type | arguments | description |
---|---|---|---|
array | array |
The input array to be sorted. |
|
compare | function | <optional> |
The comparison function. |
The sorted result.