A Very Big Sum

  • + 0 comments
    function aVeryBigSum(ar) {
        let total = 0;
        for(let item of ar){
            if(Array.isArray(item)) total += aVeryBigSum(item);
            total += item;
        }
        return total;
    }