reverse Example

.reverse() Example

The general syntax for this method is:

arrayName.reverse()

This method is straightforward - it reverses the order of the elements in the array.

No arguments are placed inside the parentheses ().

Example
let arr = ['At', 'banana', 'orange', 'apple', 'zoo'];

arr.reverse();
console.log(arr);

Output

[ 'zoo', 'apple', 'orange', 'banana', 'At' ]