count-between
v3.0.0
Published
Counts up and down between two numbers
Downloads
66
Maintainers
Readme
count-between
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
{Function}({?Number})
Count-between instance.
Instance API
Parameters
modifier
{?Number}
Returns
{Number}
Current number.