An open API service indexing awesome lists of open source software.

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

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';
```