Pages: 1 2 3 4 5 6

Clumpy Usage Guide

Nesting

To nest loops, just put a chain or a loop in the statements block of another loop. They can be nested indefinitely.

var i, j;
    
clumpy.
for_loop(
    function () { i = 0; },
    function () { return i < 100000; },
    function () { i++; },
    function () {
        clumpy.
        for_loop(
            function () { j = 0; },
            function () { return j < 5; },
            function () { j++; },
            function () {
                // statements
            }
        ).
        once(function () {
            // statements
        });
    }
);

Next Page: Break and Continue

© Thomas Peri