Counts up and down between two numbers.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
test
.gitignore
.travis.yml
LICENSE
README.md
package.json

README.md

count-between

Travis Build Status Coverage Status Dependencies

Count up and down between two numbers.

Install

npm install count-between

Usage

const c = require('count-between')(2, 5, 5)

c(1) // 2
c(1) // 3
c(3) // 2
c(-2) // 4
c(0) // 4
c() // 4

API

Parameters

  • min {Number} Minimum number.
  • max {Number} Maximum number.
  • initial {Number} Initial number.

Returns

Instance API

Parameters

  • modifier {?Number}

Returns

  • {Number} Current number.