JavaScript Array toReversed()

Definition and usage

toReversed() The method reverses the order of elements in the array.

toReversed() The method returns a new array.

toReversed() The method does not overwrite the original array.

toReversed() The method is reverse() A copy version of the method.

See also:

reverse() method

Example

// Create an array
const fruits = ["Banana", "Orange", "Apple", "Mango"];
// Reverse the array
const fruits2 = fruits.toReversed();

Try it yourself

Syntax

array.toReversed()

Parameter

None.

Return value

Type Description
Array New array with reversed element order.

Browser support

toReversed() It is an ES2023 feature.

Starting from July 2023, all modern browsers support this method:

Chrome Edge Firefox Safari Opera
Chrome 110 Edge 110 Firefox 115 Safari 16.4 Opera 96
February 2023 February 2023 July 2023 March 2023 May 2023