← TechnologyThe essentials of

toReversed(): reverse order in a new array

Publisher: ResumeMaker • 1 source

Published: 22 Oct 2026 13:13 · Updated: 22 Oct 2026 13:13

AI source check: 21 Oct 2026 12:40. This is not editorial approval.

In a few sentences

In brief

Reversing is not sorting by date or value.

Useful to know

toReversed() creates an array with the reverse order of the elements and leaves the original unchanged. In [" a", "b", "in "] the result is [" c", "b", "a "]. [1]

Use it when the order already makes sense and you want the reverse display. The method does not read dates and compare numbers. If the records are unordered, flipping won't make them chronological. For objects, the usual limit of shallow copy applies: the container is new, but nested entries do not become automatically independent.

Sources

For further detail and to check the information:

  1. [1] MDN — Array.toReversed ↗