JavaScript Array toReversed() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Array

Definition

Array.prototype.toReversed() returns a new array with the elements in reverse order. The original array stays unchanged. Contrast that with reverse(), which flips the array in place.

Remember
array.toReversed()  →  new reversed array

original untouched  ✓
no parameters       ✓

reverse()     → mutates in place
toReversed()  → new copy (ES2023)

Syntax

Call array.toReversed. Start with this line.

JavaScript
array.toReversed()
CallWhat it does
array.toReversed()Primary signature — no arguments.
array.toReversed(...)Call with empty parentheses; extra args are ignored.

Built into JavaScript. Call toReversed() on an array instance — no import required.

Library declarations
JavaScript
array.toReversed()

Parameters

ParameterDescription
—None — call with empty parentheses: toReversed()

Return Value

Return ValueDescription
*New array with elements in reverse order

JavaScript Examples

Example 1 — Basic Reverse Copy

Flip a number array and keep the original intact.

JavaScript
const numbers = [1, 2, 3, 4, 5];
const flipped = numbers.toReversed();

console.log(flipped);
console.log(numbers);
Try It Yourself

How It Works

  1. Start with five numbers. Order is 1 … 5.
  2. Call toReversed(). Builds a new array with ends swapped.
  3. flipped is reversed. You get [5, 4, 3, 2, 1].
  4. Original stays. numbers is still [1, 2, 3, 4, 5].

Example 2 — toReversed vs reverse

Side by side: one method copies, the other mutates.

JavaScript
const a = [1, 2, 3];
const b = [1, 2, 3];

const copy = a.toReversed();
b.reverse();

console.log("a (source):", a);
console.log("copy:", copy);
console.log("b (mutated):", b);
console.log("a === copy:", a === copy);
Try It Yourself

How It Works

  1. Two matching arrays. a and b both start as [1, 2, 3].
  2. toReversed on a. copy is new; a stays [1, 2, 3].
  3. reverse on b. b itself becomes [3, 2, 1].
  4. Different objects. a === copy is false — safe for immutable updates.

Example 3 — Reverse a String

Split into characters, toReversed(), then join — without mutating a shared array.

JavaScript
const greeting = "Hello";
const chars = greeting.split("");

const reversed = chars.toReversed().join("");

console.log(reversed);
console.log(chars);
Try It Yourself

How It Works

  1. Split into characters. split("") → ["H","e","l","l","o"].
  2. toReversed the array. New order: ["o","l","l","e","H"].
  3. Join back. join("") rebuilds "olleH".
  4. chars unchanged. Unlike reverse(), the character array stays original.

Browser & Runtime Support

Array.prototype.toReversed() was added in ES2023 with the other immutable array helpers (toSorted, toSpliced, with).

✓ Baseline · ES2023

Array.prototype.toReversed()

Supported in Chrome 110+, Firefox 115+, Safari 16+, Edge 110+, and Node.js 20+. Not available in Internet Explorer or very old browsers.

92% Modern browsers
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
Array.toReversed() Good

Bottom line: For older targets, feature-detect with if ("toReversed" in Array.prototype) or fall back to [...arr].reverse() (that fallback mutates the copy only).

Frequently Asked Questions

toReversed() returns a new array with the elements in reverse order. The original array is left unchanged.
No. toReversed() always returns a new array. The array you call it on keeps its original order.
reverse() flips the array in place and returns the same reference. toReversed() (ES2023) returns a new reversed copy and leaves the source alone.
A new array with elements in reverse order. Assign the result: const flipped = arr.toReversed(). Ignoring the return does nothing useful.
No. Call it with empty parentheses: array.toReversed(). There are no arguments to pass.
toReversed() is ES2023. It works in Chrome 110+, Firefox 115+, Safari 16+, Edge 110+, and Node.js 20+. For older environments, copy then reverse: [...arr].reverse().

Next: toSorted()

Learn how to get a sorted copy without mutating the original array.

toSorted() →

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.

11 people found this page helpful