Lodash _.spread() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Function

Definition

Creates a function that invokes func with an array of arguments much like Function#apply. Based on the spread operator. Part of Lodash 4.x Function (since 3.2.0).

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

Syntax

Call _.spread. Start with this line.

Lodash
_.spread(func, [start=0])
CallWhat it does
_.spread(func, [start=0])Primary signature.
_.spread(func)Wrap or transform a function.

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

Library declarations
Lodash
_.spread(func, [start=0])

Parameters

ParameterDescription
funcRequired. Function that takes separate parameters
startOptional. Index of the array to expand; default 0

Return Value

Return ValueDescription
*New spread-style wrapper

Lodash Examples

Example 1 — Official: Expand a Pair

Pass one array; the wrapper fills two parameters.

Lodash
var say = _.spread(function(who, what) {
  return who + " says " + what;
});

say(["fred", "hello"]);
// → "fred says hello"
Try It Yourself

How It Works

  1. Wrap. _.spread builds a reusable adapter.
  2. Call. Pass ["fred", "hello"] as the first argument.
  3. Expand. Lodash applies the array as who, what.
  4. Result. "fred says hello".

Example 2 — Official: Promise.all Tuple

When a promise resolves to an array, spread it into the next function.

Lodash
var add = _.spread(function(x, y) {
  return x + y;
});

// Same idea as: Promise.all([...]).then(_.spread(add))
add([40, 36]);
// → 76
Try It Yourself

How It Works

  1. Tuple. Promise.all often resolves to [x, y, …].
  2. then. Docs pass _.spread(fn) so fn gets separate args.
  3. Here. We call add([40, 36]) the same way synchronously.
  4. Result. 40 + 36 = 76.

Example 3 — Custom start

Keep a leading scalar; spread the array that follows.

Lodash
var tagged = _.spread(function(label, a, b) {
  return label + ": " + (a + b);
}, 1);

tagged("sum", [10, 5]);
// → "sum: 15"
Try It Yourself

How It Works

  1. start 1. First argument stays a normal value.
  2. Array. Second argument [10, 5] is expanded.
  3. Call. Inner function receives ("sum", 10, 5).
  4. Use. Mix context/meta with a payload array.

Example 4 — Math.max from an Array

Classic apply use-case — same idea with Lodash.

Lodash
var maxOf = _.spread(Math.max);

maxOf([3, 9, 2, 7]);
// → 9
Try It Yourself

How It Works

  1. Native need. Math.max wants separate numbers, not an array.
  2. Spread. maxOf([3, 9, 2, 7]) → Math.max(3, 9, 2, 7).
  3. Result. 9.
  4. Alt. Native Math.max(...arr) is fine when you don’t need a Lodash wrapper.

Example 5 — _.spread vs _.rest

Opposite directions: expand an array vs gather arguments.

Lodash
var expand = _.spread(function(who, what) {
  return who + " says " + what;
});
expand(["fred", "hello"]);
// → "fred says hello"

var gather = _.rest(function(head, tail) {
  return { head: head, tail: tail };
});
gather("a", "b", "c");
// → { head: "a", tail: ["b", "c"] }
Try It Yourself

How It Works

  1. Spread. One array → many parameters.
  2. Rest. Many parameters → one array.
  3. Docs. Modeled after spread vs rest operators.
  4. Pick. Use spread for Promise/array pipelines; rest for variadic callers.

Browser & Runtime Support

_.spread is a Lodash 4.x Function helper (added in 3.2.0). It runs anywhere Lodash runs — modern browsers (via CDN or bundle) and Node.js / Bun / Deno with npm install lodash.

✓ Stable · Lodash 3.2.0+

_.spread()

Available in [email protected] full builds and the lodash/spread modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.

100% With Lodash 3.2.0+
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
_.spread Lodash 3.2.0+

Bottom line: Safe for production once Lodash 3.2.0+ is on the page or in your bundle. Prefer import spread from "lodash/spread" for smaller builds. For gathering args into an array, use _.rest.

Frequently Asked Questions

_.spread(func, [start=0]) returns a wrapper that invokes func by expanding the array (or array-like value) at the start index into individual arguments — much like Function#apply for that segment.
_.rest gathers many call-site arguments into one array. _.spread expands one array argument into many parameters. They are complementary transforms.
Similar idea for the spread segment. _.spread returns a reusable wrapper with an optional start offset and fits naturally with Promise.then.
Yes. Promise.all([...]).then(_.spread(fn)) is the official pattern when async work resolves to a tuple array.
It is the index of the array to expand. Default 0 means the first argument must be the array. A higher start keeps leading scalars and spreads the array at that position.
Use import spread from "lodash/spread" or require("lodash/spread") for tree-shaking friendly bundles. Full build: import _ from "lodash" then _.spread.

Next: _.throttle()

Create a throttled function that invokes at most once per wait interval.

_.throttle() 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