Lodash _.prototype.reverse() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Seq

Definition

The wrapper version of _.reverse. Reverses the wrapped array and returns a Lodash wrapper. Part of Lodash Seq (since 0.1.0).

Call it on a Lodash wrapper. Finish with .value() when you need a plain result.

Syntax

Call _.prototype.reverse(). Start with this line.

Lodash
wrapper.reverse()
CallWhat it does
wrapper.reverse()Primary signature.

Prefer import _ from "lodash" (full build) when you need wrapper prototype helpers.

Library declarations
Lodash
wrapper.reverse()

Parameters

ParameterDescription
ReceiverRequired. A Lodash wrapper around an array

Return Value

Return ValueDescription
*New wrapper; array mutated on flush

Lodash Examples

Example 1 — Official Reverse

Reverse a wrapped array and unwrap.

Lodash
var array = [1, 2, 3];

_(array).reverse().value();
// → [3, 2, 1]
Try It Yourself

How It Works

  1. Wrap. _(array) creates a Seq wrapper.
  2. Reverse. Queues / runs reverse on the wrapped array.
  3. Unwrap. .value() returns [3, 2, 1].
  4. Docs. Matches the official Lodash example.

Example 2 — Original Array Mutated

The same array object is reversed in place.

Lodash
var array = [1, 2, 3];

_(array).reverse().value();

JSON.stringify(array);
// → "[3,2,1]"
Try It Yourself

How It Works

  1. Same reference. The wrapper points at array.
  2. Mutate. Reverse changes that array in place.
  3. After. Logging array shows [3, 2, 1].
  4. Note. Official docs call this out explicitly.

Example 3 — Deferred Until Flush

Mutation may wait until .value() or .commit().

Lodash
var array = [1, 2, 3];
var wrapped = _(array).reverse();

JSON.stringify(array);
// → "[1,2,3]"   (often still original)

wrapped.value();

JSON.stringify(array);
// → "[3,2,1]"
Try It Yourself

How It Works

  1. Queue. .reverse() is pending on the wrapper.
  2. Before. Reading array may still show the old order.
  3. Flush. .value() applies the reverse.
  4. Tip. Use .commit() to apply early and keep chaining.

Example 4 — Reverse a Copy

Keep the original order by wrapping a shallow copy.

Lodash
var array = [1, 2, 3];

_(array.slice()).reverse().value();
// → [3, 2, 1]

JSON.stringify(array);
// → "[1,2,3]"   (original untouched)
Try It Yourself

How It Works

  1. Copy. array.slice() makes a new array.
  2. Wrap. Reverse mutates only that copy.
  3. Original. array stays [1, 2, 3].
  4. Use. Prefer this when callers still need the old order.

Example 5 — Map, Then Reverse

Combine transforms in one chain.

Lodash
_(["a", "b", "c"])
  .map(function (s) { return s.toUpperCase(); })
  .reverse()
  .value();
// → ["C", "B", "A"]
Try It Yourself

How It Works

  1. Map. Uppercase each string → ["A","B","C"].
  2. Reverse. Flip order → ["C","B","A"].
  3. Unwrap. .value() returns the plain array.
  4. Note. Intermediate arrays from map are new — mutation hits that result, not your source literals in the same way as wrapping an existing variable.

Browser & Runtime Support

Wrapper .reverse() is a Lodash Seq prototype method (since 0.1.0). It relies on array reverse semantics and needs no special browser APIs beyond loading Lodash.

✓ Stable · Lodash 0.1.0+

_.prototype.reverse()

Available in [email protected] full builds when using _(value) / _.chain(value). Works in evergreen browsers and Node / Bun / Deno when Lodash is installed.

100% With Lodash
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
.reverse() Lodash 0.1.0+

Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer the full lodash build for Seq / wrapper APIs.

Frequently Asked Questions

It is the wrapper version of _.reverse. Official docs: _(array).reverse().value() → [3,2,1], and the original array is also [3,2,1] because the method mutates.
Yes. Official note: This method mutates the wrapped array — same idea as Array.prototype.reverse().
No. It returns a Lodash wrapper. Call .value() to unwrap the reversed array.
Often deferred until .value() or .commit(). Before that, the original array may still look unchanged.
Work on a copy first, e.g. _([].concat(array)).reverse().value() or _(array.slice()).reverse().value().
Yes — _.reverse(array) exists as an Array method. Wrapper .reverse() is listed as _.prototype.reverse() and is used inside chains.

Next: .value()

Execute the chain and unwrap to plain JavaScript data.

.value() 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.

8 people found this page helpful