num-sort
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.0.0
    3,133
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 3.0.0
    3,133
  • 2.1.0
    464,422
  • 2.0.0
    24
  • 1.0.0
    414

Package Sidebar

Install

npm i num-sort

Weekly Downloads

467,993

Version

3.0.0

License

MIT

Unpacked Size

3.38 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus