0 points

sum(1)(2)(3)(4)..( n)()


dashboard

Thu Nov 05 2020 15:49:25 GMT+0000 (UTC)

Posted by @snigdhakhurana10

let sumRecursive = function(a){
    return function(b){
        if(b){
            return sumRecursive(a+b);
        }
        return a;
    }
}

console.log(sumRecursive(1)(2)(3)());
content_copy Copy