JavaScript reverse()Method
Examples
Reverse the order of the elements in the array:
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.reverse();
fruits.reverse();
fruitsOutput result:
Mango,Apple,Orange,Banana
Try it Yourself »
Definition and Usage
The reverse() method is used to reverse the order of the elements in an array.
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support reverse().
Syntax
array.reverse()
Return Value
| Type | Description |
|---|---|
| Array | The array with the reversed order |
Technical Details
| JavaScript Version: | 1.1 |
|---|
Other Extensions
JavaScript Array Object