3.0.0 • Published 3 years ago

num-sort v3.0.0

Weekly downloads
4,707
License
MIT
Repository
github
Last release
3 years ago

num-sort

Sort an array of numbers

Install

$ npm install num-sort

Usage

import {numberSortAscending} from 'num-sort';

[9, -3, -Infinity, 24, NaN].sort(numberSortAscending);
//=> [NaN, -Infinity, -3, 9, 24]

API

numberSortAscending

Ascending sort comparator.

numberSortDescending

Descending sort comparator.

Related

  • alpha-sort - Alphabetically sort an array of strings