num-sort
Sort an array of numbers
Last updated 6 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install num-sort 
SYNC missed versions from official npm registry.

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

Current Tags

  • 3.0.0                                ...           latest (4 years ago)

4 Versions

  • 3.0.0                                ...           4 years ago
  • 2.1.0                                ...           5 years ago
  • 2.0.0                                ...           6 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (0)
None
Dev Dependencies (3)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |