adv-number-sort
v1.0.0
Published
Sorts a number array ascending or descending
Downloads
4
Maintainers
Readme
adv-number-sort
Sorts a number array in ascending or descending order
Install
$ npm install --save adv-number-sort
Examples
var advSort = require('adv-number-sort');
console.log(advSort([1, 2, 3, 4], "desc"));
// -> [4, 3, 2, 1]
console.log(advSort([4, 3, 2, 1], "asc"));
// -> [1, 2, 3, 4]
Usage
require('o-size')( array, option )
Arguments:
array
: list of numbersoption
: asc | desc, asc for sorting in ascending order, and desc for desending
Returns: Returns number array in ascending or descending order
License
© 2016 vikram. MIT License