Javascript Array reverse() method

The reverse() method is used to reverse the order of elements in an array. It modifies the array in place and returns a reference to the same array with the reversed order.

Syntax:

array.reverse()

Example : Here is an example shows the use of the Array reverse() method.

JavaScript
let array = [1, 2, 3, 4, 5];
array.reverse();
console.log(array);

Output
[ 5, 4, 3, 2, 1 ]

JavaScript Array Methods

JavaScript array methods are built-in functions that allow efficient manipulation and traversal of arrays. They provide essential functionalities like adding, removing, and transforming elements, as well as searching, sorting, and iterating through array elements, enhancing code readability and productivity.

Learn More on JavaScript Array

Now let’s look at the JS array methods and properties.

Similar Reads

JavaScript Array Methods

Below is the JavaScript Array Methods list, covering all important array methods and properties in JavaScript with examples....

JavaScript Array length

The length property returns the length of the given array....

JavaScript Array toString() Method

The toString() method converts the given value into the string....

JavaScript Array join() Method

This join() method helps to join two arrays as a string. If we pass any parameter to this method it will join the array by using that parameter....

JavaScript Array delete Operator

The delete operator is used to delete the given value which can be an object, array, or anything....

JavaScript Array concat() Method

The concat() method is used to concatenate two or more arrays and it gives the merged array....

JavaScript Array flat() Method

The flat() method is used to flatten the array i.e. it merges all the given array and reduces all the nesting present in it....

Javascript Array.push() Method

The push() method is used to add an element at the end of an Array. As arrays in JavaScript are mutable objects, we can easily add or remove elements from the Array. And it dynamically changes as we modify the elements from the array....

Javascript Array.unshift() Method

The unshift() method is used to add elements to the front of an Array....

JavaScript Array.pop() Method

The pop() method is used to remove elements from the end of an array....

JavaScript Array.shift() Method

The shift() method is used to remove elements from the beginning of an array...

JavaScript Array.splice() Method

The splice() method is used to Insert and Remove elements in between the Array....

JavaScript Array.slice() Method

The slice() method returns a new array containing a portion of the original array, based on the start and end index provided as arguments...

JavaScript Array some() Method

The some() method checks whether at least one of the elements of the array satisfies the condition checked by the argument function....

JavaScript Array reduce() Method

The reduce() method is used to reduce the array to a single value and executes a provided function for each value of the array (from left to right) and the return value of the function is stored in an accumulator....

JavaScript Array map() Method

The map() method creates an array by calling a specific function on each element present in the parent array. It is a non-mutating method. This method iterates over an array and calls the function on every element of an array....

Javascript Array reverse() method

The reverse() method is used to reverse the order of elements in an array. It modifies the array in place and returns a reference to the same array with the reversed order....

JavaScript Array Complete Reference

We have created a complete list of array methods, please check this article JavaScript Array Complete Reference for more details....