Currying Function in JavaScript Last Updated : 10 Aug, 2025 Comments Improve Suggest changes Like Article Like Report Currying is used in JavaScript to break down complex function calls into smaller, more manageable steps. It transforms a function with multiple arguments into a series of functions, each taking a single argument.It converts a function with multiple parameters into a sequence of functions.Each function takes a single argument and returns another function until all arguments are received.Helps in functional programming by enabling function reusability and composition. JavaScript // Normal Function // function add(a, b) { // return a + b; // } // console.log(add(2, 3)); // Function Currying function add(a) { return function(b) { return a + b; } } const addTwo = add(5); // First function call with 5 console.log(addTwo(4)); Output9 In this exampleNormal Function: Directly takes two arguments (a and b) and returns their sum.Function Currying: Breaks the add function into two steps. First, it takes a, and then, when calling addTwo(4), it takes b and returns the sum.How Currying Works in JavaScript?Currying function in the JavaScript can be done manually, but it can also be done using the closure. Below it is shown that how currying function works.Creating the First Function: The first function takes the first argument and gives back a new function to take the next one.Returning a New Function: The returned function takes the next argument and keeps going until all the arguments are given.Returning the Result: Once all the arguments are provided, the final result is calculated and returned.Currying with Arrow FunctionsArrow function can be used to make currying function short: JavaScript const add = a => b => a + b; console.log(add(5)(4)); Output9 This syntax is shorter and doining the same thing as the earlier example.When to Use Currying in JavaScript?In JavaScript, currying function is used in the following cases:Partial Application: In the partial application we set some arguments in advance in the function and call it later with the remaining arguments.Higher-Order Functions: When one function takes the other functions as arguments (eg: map, filter, reduce) in that case we can use the currying function to manage the arguments more effectively.Functional Programming: Where functions are treated as important and focus is on not changing data and combining functions in those cases currying works perfectly. What is currying function in JavaScript ? Comment More info M mrtwinklesharma Follow Improve Article Tags : JavaScript Web Technologies javascript-functions JavaScript-Questions Explore JavaScript BasicsIntroduction to JavaScript4 min readVariables and Datatypes in JavaScript6 min readJavaScript Operators5 min readControl Statements in JavaScript4 min readArray & StringJavaScript Arrays7 min readJavaScript Array Methods7 min readJavaScript Strings6 min readJavaScript String Methods9 min readFunction & ObjectFunctions in JavaScript5 min readJavaScript Function Expression3 min readFunction Overloading in JavaScript4 min readObjects in Javascript4 min readJavaScript Object Constructors4 min readOOPObject Oriented Programming in JavaScript3 min readClasses and Objects in JavaScript4 min readWhat Are Access Modifiers In JavaScript ?5 min readJavaScript Constructor Method7 min readAsynchronous JavaScriptAsynchronous JavaScript2 min readJavaScript Callbacks4 min readJavaScript Promise4 min readEvent Loop in JavaScript4 min readAsync and Await in JavaScript2 min readException HandlingJavascript Error and Exceptional Handling6 min readJavaScript Errors Throw and Try to Catch2 min readHow to create custom errors in JavaScript ?2 min readJavaScript TypeError - Invalid Array.prototype.sort argument1 min readDOMHTML DOM (Document Object Model)9 min readHow to select DOM Elements in JavaScript ?3 min readJavaScript Custom Events4 min readJavaScript addEventListener() with Examples9 min readAdvanced TopicsClosure in JavaScript4 min readJavaScript Hoisting6 min readJavascript Scope3 min readJavaScript Higher Order Functions7 min readDebugging in JavaScript4 min read Like