Reverse Array element in Javascript

Virendradugar
Posted by Virendradugar under JavaScript category on | Views : 2364
Javascript provides an inbuilt method to reverse an array. See below code.


<script type="text/javascript" language="javascript">

function ReverseArray()
{
var arr1 = new Array(1,2,3,4,5);
arr1.reverse();
alert(arr1);
}

</script>

Comments or Responses

Login to post response