JavaScript Array reverse()

Example

const fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.reverse();
Try it Yourself »

Description

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

The reverse() method overwrites the original array.


Syntax

array.reverse()

Return Value

The array after it has been reversed.

Browser Support

reverse() is an ECMAScript1 (ES1) feature.

ES1 (JavaScript 1997) is fully supported in all browsers:

Chrome Edge Firefox Safari Opera IE
Yes Yes Yes Yes Yes Yes


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.