sort-selection
v1.1.0
Published
A simple and fast implementation of selection sort
Downloads
3
Maintainers
Readme
sort-selection
Selection sort for arrays.
Returns a sorted array, original array stays untouched.
example
import sort from 'sort-selection'
sort([6, 2, 5, 3], function (a, b) {
return a > b
}) // returns [2, 3, 5, 6]
sort(['hello', 'how', 'are', 'you', '?'], function (a, b) {
return a.length > b.length
}) // returns ['?', 'how', 'are', 'you', 'hello']