The reverse method

The reverse() method is used to reverse the order of the elements in an array. It is not necessary to send parameters or return values from it.

var Fruits = new Array("bananas" , "apples" , "pears", "mangoes");
document.write(Fruits);
Fruits.reverse();
document.write("<br>"+Fruits);

Leave a Reply