Returns the rest of the elements in an array. Pass an index to return values from that index onward (official Underscore docs). Aliases: tail, drop. Stable — not deprecated.
Pass the required arguments shown below. Underscore array helpers usually return a new value — check whether the source array is mutated.
Syntax
Call _.rest. Start with this line.
Underscore
_.rest(array, [index])
Call
What it does
_.rest(array, [index])
Primary signature.
_.rest(...)
Call with the arguments your case needs.
Load Underscore with import _ from "underscore" (or the UMD CDN build) so these helpers are available as _.
_.rest (and aliases _.tail / _.drop) ships with Underscore.js (1.x). It runs anywhere Underscore runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install underscore.
✓ Stable · Underscore 1.x
_.rest()
Available in [email protected] (UMD / ESM). Works in evergreen browsers and current Node LTS when Underscore is loaded.
100%With Underscore 1.x
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
_.restUnderscore 1.x+
Bottom line: Safe for production once Underscore is on the page or in your bundle. Not a native browser API — load Underscore first. Prefer a pinned CDN version (e.g. [email protected]). Native equivalent: array.slice(index).
Frequently Asked Questions
_.rest(array) returns a new array with everything except the first element. Pass an index as _.rest(array, index) to return values from that index onward.
_.tail and _.drop are aliases of _.rest — they behave identically. Use whichever name reads best.
It is the start position in the array (like Array.prototype.slice). Omit it and Underscore starts at index 1 — dropping just the first element.
An empty array []. Dropping past the end also returns [], never an error.
_.rest drops from the front and keeps the tail. _.initial drops from the end and keeps the front.
No. It returns a new array; the source is left unchanged.