Creates a function that invokes func with arguments from start and beyond provided as an array. Based on the rest parameter. Part of Lodash 4.x Function (since 4.0.0; Lodash 3 named this _.restParam).
Pass the required arguments shown below. Most helpers return a new function you call later.
Syntax
Call _.rest. Start with this line.
Lodash
_.rest(func, [start=func.length-1])
Call
What it does
_.rest(func, [start=func.length-1])
Primary signature.
_.rest(func)
Wrap or transform a function.
Prefer import rest from "lodash/rest" when you want a smaller bundle.
Library declarations
Lodash
_.rest(func, [start=func.length-1])
Parameters
Parameter
Description
func
Required. Function that accepts a trailing array
start
Optional. Index where collection begins; default func.length - 1
Return Value
Return Value
Description
*
New rest-style wrapper
Lodash Examples
Example 1 — Official: Greeting + Names
First argument stays alone; the rest become a names array.
Rest. Many call-site values → one array parameter.
Spread. One array value → many parameters.
Pair. Docs model them after rest and spread operators.
Pick. Use rest to accept lists; use spread for Promise/array pipelines.
Compatibility
Browser & Runtime Support
_.rest is a Lodash 4.x Function helper (added in 4.0.0; formerly _.restParam in 3.x). It runs anywhere Lodash runs — modern browsers (via CDN or bundle) and Node.js / Bun / Deno with npm install lodash.
✓ Stable · Lodash 4.0.0+
_.rest()
Available in [email protected] full builds and the lodash/rest modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.
100%With Lodash 4.0.0+
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
_.restLodash 4.0.0+
Bottom line: Safe for production once Lodash 4.0.0+ is on the page or in your bundle. Prefer import rest from "lodash/rest" for smaller builds. For expanding arrays into args, use _.spread.
Frequently Asked Questions
_.rest(func, [start=func.length-1]) returns a wrapper that invokes func with arguments from start onward collected into one trailing array argument — like ES rest parameters applied at runtime.
func.length - 1. So the last formal parameter of func typically receives the collected array, and earlier parameters stay as individual values.
Native rest lives in the function declaration. _.rest wraps an existing function so you can add rest-style collection without rewriting its source signature.
_.rest gathers many call-site args into one array for the wrapped function. _.spread does the opposite — expands an array into separate arguments.
The wrapper uses the this binding of the created function when calling func — same idea as a normal method-style call unless you bind further.
Use import rest from "lodash/rest" or require("lodash/rest") for tree-shaking friendly bundles. Full build: import _ from "lodash" then _.rest.