Lodash _.curry() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Function

Definition

Creates a function that accepts arguments of func and either invokes func when at least arity arguments are provided, or returns a function that accepts the remaining arguments. Part of Lodash 4.x Function (since 2.0.0).

Pass the required arguments shown below. Most helpers return a new function you call later.

Syntax

Call _.curry. Start with this line.

Lodash
_.curry(func, [arity=func.length])
CallWhat it does
_.curry(func, [arity=func.length])Primary signature.
_.curry(func)Wrap or transform a function.

Prefer import curry from "lodash/curry" when you want a smaller bundle.

Library declarations
Lodash
_.curry(func, [arity=func.length])

Parameters

ParameterDescription
funcRequired. Function to curry
arityOptional. How many args until invoke; defaults to func.length
guardOptional. When truthy, arity is ignored (iteratee-safe)

Return Value

Return ValueDescription
*Curried function (with .placeholder)

Lodash Examples

Example 1 — One Argument at a Time

Classic unary-style chain until arity is filled.

Lodash
var abc = function (a, b, c) {
  return [a, b, c];
};

var curried = _.curry(abc);
curried(1)(2)(3);
// → [1, 2, 3]
Try It Yourself

How It Works

  1. Wrap. _.curry(abc) uses arity 3 from abc.length.
  2. First call. Stores 1; returns another function.
  3. Second. Stores 2; still one slot open.
  4. Third. Arity met → abc(1, 2, 3).

Example 2 — Mix Batch Sizes

Pass several arguments in one step — still the same result.

Lodash
var abc = function (a, b, c) {
  return [a, b, c];
};

var curried = _.curry(abc);

[curried(1, 2)(3), curried(1, 2, 3)];
// → [[1, 2, 3], [1, 2, 3]]
Try It Yourself

How It Works

  1. Flexible. Lodash counts total collected args, not call count.
  2. Two + one. (1, 2) leaves one slot; (3) finishes.
  3. All at once. Three args in one call invoke immediately.
  4. Same docs. Matches the official multi-style examples.

Example 3 — Placeholder

Skip a middle argument and fill it on the next call.

Lodash
var abc = function (a, b, c) {
  return [a, b, c];
};

var curried = _.curry(abc);
curried(1)(_, 3)(2);
// → [1, 2, 3]
Try It Yourself

How It Works

  1. First. Locks a = 1.
  2. Second. _ reserves b; sets c = 3.
  3. Third. 2 fills the placeholder → [1, 2, 3].
  4. Modular. Use _.curry.placeholder instead of _.

Example 4 — Explicit Arity

Override func.length when it is wrong or incomplete.

Lodash
function sum() {
  return _.sum(arguments);
}

var curried = _.curry(sum, 3);
curried(1)(2)(3);
// → 6
Try It Yourself

How It Works

  1. Problem. sum.length is 0 (uses arguments).
  2. Fix. Pass 3 as arity so curry waits for three values.
  3. Invoke. After three args, sum runs and totals them.
  4. When. Also useful with default params or rest parameters.

Example 5 — curry vs curryRight

Same function; opposite fill order.

Lodash
var abc = function (a, b, c) {
  return [a, b, c];
};

var left = _.curry(abc);
var right = _.curryRight(abc);

[left(1)(2)(3), right(3)(2)(1)];
// → [[1, 2, 3], [1, 2, 3]]
Try It Yourself

How It Works

  1. curry. First supplied value is a, then b, then c.
  2. curryRight. First supplied value is c, then b, then a.
  3. Result. Both end as [1, 2, 3] when filled carefully.
  4. Pick. Default left-to-right APIs → curry; trailing-first → curryRight.

Browser & Runtime Support

_.curry is a Lodash 4.x Function helper (since 2.0.0). It needs no special browser APIs beyond loading Lodash.

✓ Stable · Lodash 2.0.0+

_.curry()

Available in [email protected] full builds and the lodash/curry modular import. Works in evergreen browsers and Node / Bun / Deno when Lodash is installed.

100% With Lodash 4.x
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
_.curry Lodash 4.x+

Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import curry from "lodash/curry" for smaller builds. Remember: curried.length is not set.

Frequently Asked Questions

_.curry(func, [arity]) returns a function that accepts arguments left to right. When enough arguments are collected (arity), it invokes func; otherwise it returns another function for the rest.
When func.length is unreliable — rest params, defaults, or transpiled code. Pass the real parameter count as the second argument.
A sentinel (often _ in the full Lodash build) marking argument slots to fill on a later call. In modular imports use curry.placeholder.
Curry lets you supply any number of remaining args across multiple calls until arity is met. Partial fixes specific leading values once and does not require filling every slot through successive curry steps.
No. Lodash notes curried wrappers do not set the length property — do not rely on curried.length for arity checks.
Use import curry from "lodash/curry" then curry.placeholder for deferred slots. Full build: import _ from "lodash" then _.curry.

Next: _.curryRight()

Curry a function from the right — first supplied value fills the last parameter.

_.curryRight() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

10 people found this page helpful