sort-array-open

1.0.1 • Public • Published

#sort-array-open package

Use this package to sort an array in ascending or descending order.

The package contains three functions:

  • removeFalsy
  • sortAsc
  • sortDesc

#removeFalsy

Use this function to remove any falsy values such as null and undefined.

Example: removeFalsy([1, 4, 2, , 4, null, 0, 3]) Result: [ 1, 4, 2, 4, 0, 3 ]

#sortAsc

Use this function to sort an array in ascending order (it will remove all falsy values in the result).

Example: sortAsc([1, 4, 2, , 4, null, 00, 3]) Result: [ 0, 1, 2, 3, 4, 4 ]

#sortDesc

Use this function to sort an array in descending order (it will remove all falsy values result).

Example: sortDesc([1, 4, 2, , 4, null, 00, 3]) Result: [ 4, 4, 3, 2, 1, 0 ]

Readme

Keywords

none

Package Sidebar

Install

npm i sort-array-open

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

2.38 kB

Total Files

3

Last publish

Collaborators

  • web-dev-learn