JavaScript Array reverse()
- Previous Page reduceRight()
- Next Page shift()
- Go to the Previous Level JavaScript Array Reference Manual
Definition and usage
reverse()
The method reverses the order of elements in the array.
Note:reverse()
The method will change the original array.
Example
Reverse the order of elements in the array:
var fruits = ["Banana", "Orange", "Apple", "Mango"]; fruits.reverse();
Syntax
array.reverse()
Parameter
No parameters.
Technical details
Return value: | An array, representing the reversed array. |
---|---|
JavaScript version: | ECMAScript 1 |
Browser support
All browsers fully support reverse()
Method:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
Related Pages
Tutorial:JavaScript Array
Tutorial:JavaScript Array Const
Tutorial:JavaScript Array Methods
Tutorial:JavaScript Sort Array
Tutorial:JavaScript Array Iteration
- Previous Page reduceRight()
- Next Page shift()
- Go to the Previous Level JavaScript Array Reference Manual