@amphibian/iterate-up

while loop abstraction for iterating up with +1 as increment

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
Minified + gzip package size for @amphibian/iterate-up in KB

Readme

iterate-up

build status

while loop abstraction for iterating up with +1 as increment

npm install @amphibian/iterate-up
var iterateUp = require('@amphibian/iterate-up');

// Iterate 5 times
iterateUp(5, function (i) {
    console.log(i); // 0, 1, 2, 3, 4
});

// Iterate 5 times, but stop at 3
var question = iterateUp(5, function (i, end) {
    if (i === 3) {
        end('hola que tal');
    }

    console.log(i); // 0, 1, 2, 3
});

console.log(question); // > hola que hora es

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.