step-generator
v1.0.3
Published
Generate a sequence of numbers
Downloads
3
Readme
step-generator
Generate a sequence of numbers
Installation
$> npm install --save step-generator
Test
$> npm test
Usage
Generate a sequence of stepping numbers.
const stepGenerator = require('step-generator')
const evenGenerator = stepGenerator({ start: 2, step: 2 })
const evens = [
evenGenerator.next().value,
evenGenerator.next().value,
evenGenerator.next().value,
evenGenerator.next().value,
]
console.log(evens)
Output
[2, 4, 6, 8]