Reverse Array Elements
Object: Array_name
Method or Function: reverse
Syntax: Array_name.reverse()
If we want to reverse entire array elements, we can use the reverse function.
Example
<script type="text/javascript">
var month = new Array("January","February",
"March", "April", "May", "June",
"July","August", "September", "October", "November", "December");
var string=month.reverse();
document.write(string);
</script>
Output
No comments:
Post a Comment