javascript array reduce

How to use JavaScript Array Reverse Method

In my previous post we have discussed about sorting the array element using JavaScript in ascending and descending. JavaScript have another method called Reverse which will reverse order of array elements.

How to use JavaScript Array Reverse Method

How to use JavaScript Array Reverse Method

Reverse method will not support the compare function like Sort method.

// Create array variable and assign the element
var arrData = ["PHP","ASP","Nodejs","GO","JAVA"]

// Reverse the order of array elements using Javascript Reverse method
document.write(arrData.reverse())

// Output will : JAVA,GO,Nodejs,ASP,PHP

Please share your feedback and suggestion.