incnum

1.0.6 • Public • Published

incnum

increment numbers in array. this can make multiple depth for-loop single.

after

for (const [a, b, c, d, e] of seq([0, 0, 0, 0, 0], [1, 2, 3, 4, 5])) {
    console.log(`${a} ${b} ${c} ${d} ${e}`);
}

before

for (let a = 0; a < 1; a++) {
    for (let b = 0; b < 2; b++) {
        for (let c = 0; c < 3; c++) {
            for (let d = 0; d < 4; d++) {
                for (let e = 0; e < 5; e++) {
                    console.log(`${a} ${b} ${c} ${d} ${e}`);
                }
            }
        }
    }
}

Readme

Keywords

Package Sidebar

Install

npm i incnum

Weekly Downloads

7

Version

1.0.6

License

MIT

Unpacked Size

18.4 kB

Total Files

10

Last publish

Collaborators

  • r22n