‚̧Neck Protection Mandate
    Have ideas to improve npm?Join in the discussion! ¬Ľ

    @amphibian/iterate-down

    2.0.2¬†‚Äʬ†Public¬†‚Äʬ†Published

    iterate-down

    build status

    while loop abstraction for iterating down with -1 as increment

    npm install @amphibian/iterate-down
    
    var iterateDown = require('@amphibian/iterate-down');
     
    // Iterate 5 times from 5
    iterateDown(5, function (i) {
        console.log(i); // 4, 3, 2, 1, 0
    });
     
    // Iterate 5 times, but stop at 1
    var question = iterateDown(5, function (i, end) {
        if (i === 1) {
            end('hola que tal');
        }
     
        console.log(i); // 4, 3, 2
    });
     
    console.log(question); // > hola que hora es

    Keywords

    none

    Install

    npm i @amphibian/iterate-down

    DownloadsWeekly Downloads

    5

    Version

    2.0.2

    License

    ISC

    Last publish

    Collaborators

    • avatar