Sort an array of numbers
$ npm install num-sort
import {numberSortAscending} from 'num-sort';
[9, -3, -Infinity, 24, NaN].sort(numberSortAscending);
//=> [NaN, -Infinity, -3, 9, 24]
Ascending sort comparator.
Descending sort comparator.
- alpha-sort - Alphabetically sort an array of strings