JavaScript: Currying Function

alamfatima1999

Fatima Alam

Posted on June 15, 2024

JavaScript: Currying Function
function outsideFunction(num1){
    let acc = num1;
    return function innerFunction1(num2){
        acc+=num2;
        return function innerFunction2(num3){
            acc+=num3;
            return  acc;
        }
    }
}

outsideFunction(1)(2)(3);
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
alamfatima1999
Fatima Alam

Posted on June 15, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

What was your win this week?
weeklyretro What was your win this week?

November 29, 2024

Where GitOps Meets ClickOps
devops Where GitOps Meets ClickOps

November 29, 2024

How to Use KitOps with MLflow
beginners How to Use KitOps with MLflow

November 29, 2024