JavaScript Array Method : reverse()

The reverse() method is used to reverse the element of an array. The syntax is as follows :
  array.reverse();
Example :
<script>
  var myarray = [100, 200, 300, 400, 500];
  document.write("Array : "+ myarray + "<br/><br/>");
  myarray.reverse();
  document.write("reversed Array : " + myarray + "<br/>");
</script>
Output :


Next Topic :