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

https://github.com/fibo/is-monotonic

checks that a given sequence is strictly increasing or decreasing
https://github.com/fibo/is-monotonic

Last synced: about 1 year ago
JSON representation

checks that a given sequence is strictly increasing or decreasing

Awesome Lists containing this project

README

          

# is-monotonic

> checks that a given sequence is strictly increasing or decreasing

## Example

```javascript
const { isMonotonicIncreasing, isMonotonicDecreasing } = require('is-monotonic')

isMonotonicIncreasing([1, 2, 3, 4]) // true
isMonotonicIncreasing([1, 3, 2, 4]) // false

isMonotonicDecreasing([4, 3, 2, 1]) // true
isMonotonicDecreasing([4, 2, 3, 1]) // false
```

## See also

* [is-bullish](https://g14n.info/is-bullish)