Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2023.
The toReversed() method of Array instances is the copying counterpart of the reverse() method. It returns a new array with the elements in reversed order.
None.
A new array containing the elements in reversed order.
The toReversed() method transposes the elements of the calling array object in reverse order and returns a new array.
When used on sparse arrays, the toReversed() method iterates empty slots as if they have the value undefined.
The toReversed() method is generic. It only expects the this value to have a length property and integer-keyed properties.
The following example creates an array items, containing three elements, then creates a new array that's the reverse of items. The items array remains unchanged.
The return value of toReversed() is never sparse. Empty slots become undefined in the returned array.
The toReversed() method reads the length property of this. It then visits each property having an integer key between length - 1 and 0 in descending order, adding the value of the current property to the end of the array to be returned.
| ECMAScript® 2027 Language Specification # sec-array.prototype.toreversed |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jul 10, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.