JavaScript Array reverse() is an inbuilt function that reverses the order of the items in an array. The reverse() method will change the original array that is why it is not a pure function. Javascript reverse() returns an array that represents the array after it has been reversed. The reverse function does not take any argument.

If you want to reverse the items of the  array then Javascript array reverse() function does the job for you.

JavaScript array reverse example

The first array item becomes the last, and the last array element becomes the first due to the array reverse() method in Javascript.

JS array reverse() method transposes the items of the calling array object in place, mutating the array, and returning a reference to the array.

#javascript #js #js array reverse()

JavaScript Array Reverse Example | JS Array Reverse() Method
4.45 GEEK