Answers for "use recursation in iife in js"

0

use recursation in iife in js

(function printItems(items) {
    if (!items) {
        return;
    }

    for (var i = 0; i < items.length; i++) {
        var item = items[i];
        console.log(item.name + ' - ' + item.value);
        printItems(item.items);
    }
})(data);
Posted by: Guest on May-17-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language