https://github.com/writetome51/in-numeric-order
2 functions check if array of numbers is in ascending numeric order or not
https://github.com/writetome51/in-numeric-order
in-order javascript numbers sequential typescript
Last synced: about 1 year ago
JSON representation
2 functions check if array of numbers is in ascending numeric order or not
- Host: GitHub
- URL: https://github.com/writetome51/in-numeric-order
- Owner: writetome51
- License: mit
- Created: 2018-10-14T21:47:17.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-11-24T21:34:50.000Z (over 5 years ago)
- Last Synced: 2025-02-03T04:42:12.710Z (about 1 year ago)
- Topics: in-order, javascript, numbers, sequential, typescript
- Language: JavaScript
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# inNumericOrder(numbers): boolean
If `numbers` are in ascending order, returns true.
Each item in `numbers` must be of type 'number'.
## Examples
```js
inNumericOrder([1,2,3,4]); // --> true
inNumericOrder([-1.03, -1.02, 0.222, 0.223]); // --> true
inNumericOrder([-10, 5, -11]); // --> false
inNumericOrder([-10, '', -11]);
// --> Error: "Input must be a finite number of type 'number'"
```
## Installation
`npm i @writetome51/in-numeric-order`
## Loading
```js
import { inNumericOrder } from '@writetome51/in-numeric-order';
```