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
- Host: GitHub
- URL: https://github.com/fibo/is-monotonic
- Owner: fibo
- License: mit
- Created: 2019-07-19T09:57:30.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-19T10:17:22.000Z (about 7 years ago)
- Last Synced: 2025-05-28T18:38:59.018Z (about 1 year ago)
- Language: JavaScript
- Homepage: http://g14n.info/is-monotonic
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)