Lodash _.tail() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Array

Definition

Gets all but the first element of array. Part of Lodash Array — stable in 4.x. Renamed: in Lodash 4.0.0 this replaced the older name _.rest; use _.tail in modern code.

Pass the required arguments shown below. Lodash Array helpers usually return a new value — check whether the source array is mutated.

Syntax

Call _.tail on an array. Start with this line.

Lodash
_.tail(array)
CallWhat it does
_.tail(array)Primary signature.
_.tail(array)Call with an array argument.

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

Library declarations
Lodash
_.tail(array)

Parameters

ParameterDescription
arrayRequired. Source to query

Return Value

Return ValueDescription
*New array of elements after the first

Lodash Examples

Example 1 — Official: Numbers

Skip the first number and keep the rest.

Lodash
_.tail([1, 2, 3]);
// → [2, 3]
Try It Yourself

How It Works

  1. Source. Array [1, 2, 3]; first slot is 1.
  2. Skip head. Index 0 is left out.
  3. Keep rest. Indexes 1 and 2 → 2 and 3.
  4. New array. Result is [2, 3]; the original is untouched.

Example 2 — String Array

Works the same for any element type.

Lodash
_.tail(["red", "green", "blue"]);
// → ["green", "blue"]
Try It Yourself

How It Works

  1. First word. "red" is at index 0.
  2. Tail. Everything after → "green" and "blue".
  3. Order kept. Remaining items stay in original order.
  4. Use. Handy when the first item is a label or header.

Example 3 — One Element

A single-item array has no “rest”.

Lodash
_.tail([9]);
// → []
Try It Yourself

How It Works

  1. Only index 0. The sole value is the “first” element.
  2. Nothing after. Slice from 1 is empty.
  3. Result. [] — not undefined.
  4. Safe. No throw; check length if you need a non-empty rest.

Example 4 — Empty Array

Tailing nothing stays empty.

Lodash
_.tail([]);
// → []
Try It Yourself

How It Works

  1. Empty source. No first element and no rest.
  2. Result. Lodash returns [].
  3. Safe. Fine in pipelines that may receive empty lists.
  4. Guard. Check result.length before assuming items remain.

Example 5 — Split with _.head

Read the first item and the remainder as two values.

Lodash
var arr = [10, 20, 30];

var first = _.head(arr);  // 10
var rest  = _.tail(arr);  // [20, 30]

// arr is still [10, 20, 30]
Try It Yourself

How It Works

  1. Head. _.head reads index 0 → 10.
  2. Tail. _.tail returns the slice after that → [20, 30].
  3. No mutation. arr stays [10, 20, 30].
  4. Pattern. Classic “car / cdr” split for list processing.

Browser & Runtime Support

_.tail is a Lodash 4.x Array helper (renamed from _.rest in 4.0.0). It runs anywhere Lodash runs — modern browsers (via CDN or bundle) and Node.js / Bun / Deno with npm install lodash.

✓ Stable · Lodash 4.x

_.tail()

Available in [email protected] full builds and the lodash/tail modular import. Works in evergreen browsers and current Node LTS 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
_.tail Lodash 4.x+

Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import tail from "lodash/tail" for smaller builds. Not a native browser API — load Lodash first. Pre-4 code may still say _.rest.

Frequently Asked Questions

_.tail(array) returns a new array with every element except the first. For [1, 2, 3] the result is [2, 3].
No. It returns a new array (slice from index 1). The source array is unchanged.
Both return []. There is nothing after the first element — or no first element at all.
Yes for ordinary arrays: _.tail(arr), _.drop(arr), and arr.slice(1) all skip the first element and return a new array.
Yes. In Lodash 4.0.0, _.rest was renamed to _.tail. Prefer _.tail in modern Lodash 4.x code.
Use import tail from "lodash/tail" or require("lodash/tail") so bundlers can tree-shake. Full build: import _ from "lodash" then _.tail.

Next: _.take()

Keep a fixed number of elements from the start instead of skipping the first.

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