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

PHOTO EMBED

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

Saved by @snigdhakhurana10

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

console.log(sumRecursive(1)(2)(3)());
content_copyCOPY