is-monotonic

1.0.0 • Public • Published

is-monotonic

checks that a given sequence is strictly increasing or decreasing

Example

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    0

Package Sidebar

Install

npm i is-monotonic

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

3.29 kB

Total Files

5

Last publish

Collaborators

  • fibo