What Is Currying in JavaScript?
Currying transforms a function that takes multiple arguments into a sequence of functions that each take a single argument, one at a time.
Published November 20, 2026
Currying turns a function that takes several arguments into a chain of functions that each take one: f(a, b, c) becomes f(a)(b)(c). It lets you build specialised functions by supplying arguments gradually.
The concept
Each call returns a new function waiting for the next argument until all are supplied. It relies on closures to remember earlier arguments.
Partial application is related: fix some arguments now, supply the rest later.
One argument at a time
- add(2) returns a function that remembers 2
- That function receives 3
- It returns 2 + 3 = 5
- Reuse add(2) to make an 'add two' helper
Practical examples
Manual curry
const add = (a) => (b) => a + b
const add2 = add(2)
add2(3) // 5Generic curry helper
const curry = (fn) => function c(...a) { return a.length >= fn.length ? fn(...a) : (...b) => c(...a, ...b) }
const vol = curry((l, w, h) => l * w * h)
vol(2)(3)(4) // 24
vol(2, 3)(4) // 24Practical use
const getProp = (k) => (o) => o[k]
users.map(getProp('name'))Common mistakes
- Currying variadic functions.
- Making code cryptic when plain parameters would do.
- Forgetting the arity (fn.length) with default parameters.
Key takeaways
- f(a,b,c) → f(a)(b)(c).
- Built on closures.
- Useful for reusable, specialised functions.
FAQ
Currying vs partial application?
Currying always transforms into unary steps; partial fixes some arguments.
Do libraries help?
lodash and Ramda provide curry.