Favorites

JavaScript Array.prototype.reverse() Method

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Array.prototype.reverse()
JavaScript Array Instance methodThis method is supported by all modern browsers.
Updated 28th November 2026

The reverse() method reverses the order of the elements of an array in place.

Description

The reverse() method reverses an array in place: the first element becomes the last and the last becomes the first. It returns a reference to the same array.

Because it changes the original, use toReversed() (or [...arr].reverse()) when you need to keep it.

Because it reverses in place and returns the same array, const reversed = arr.reverse() leaves arr and reversed pointing at the same, now reversed, array. Empty slots in sparse arrays stay empty but move to their mirrored positions. To reverse a string, convert it to an array of characters first, [...str].reverse().join('').

Syntax

array.reverse()

Return Value

The same array, now reversed.

Example

const nums = [1, 2, 3];
nums.reverse();
console.log(nums);
console.log([...'hello'].reverse().join(''));

Browser Support

The following information will show you the current browser support for the Array.prototype.reverse() method. Hover over a browser icon to see the version that first introduced support for this method.

This method is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee