Here you can find a number of examples on Java Script.Please find the various kinds of examples listed on the right side of this site. If you don't find anything on Java Script then please write to us or leave a commnet. We are pleased to help and find the solution of your problem.

JavaScript: Reverse Function



reverse Function:
Transposes the elements of an array: the first array element becomes the last and the last becomes the first.

Syntax:
arrayname.revrse()

Description:
The reverse method transposes the elements of the calling array object.



Example in HEAD section:

<html>
<head>
<title>Reverse Function</title>
<script language="javascript">
example=new Array("one" , "two", "three", "four");
document.write("<p>" + example.reverse());
</script>
</head>
</html>

Example in BODY section:

<html>
<head>
<title>Reverse Function</title>
</head>
<body>
<script language="javascript">
example=new Array("one" , "two", "three", "four");
document.write("<p>" + example.reverse());
</script>
</body>
</html>



OUTPUT:

four,three,two,one

6 comments:

  1. What concerning publishing index cards?
    Gary.

    My webpage: Xerox Phaser 8560

    ReplyDelete
  2. Blogs ou really should be reading...

    My site - ,Cheap Earrings With Free Shipping

    ReplyDelete
  3. Beautiful new charms, I like pandora jewellery it's timeless.

    Feel free to surf to my homepage; silver jewellery usa

    ReplyDelete
  4. i really like the crossover bracelet

    Feel free to surf to my homepage ... silver jewellery [cw.ccsd.k12.wy.us]

    ReplyDelete
  5. Great info. Lucky me I ran across your website by chance (stumbleupon).
    I have book-marked it for later!

    Feel free to visit my page xerox 8560 solid ink

    ReplyDelete
  6. Greetings! Very helpful advice in this particular post!
    It is the little changes that make the most significant changes.
    Many thanks for sharing!

    My blog: pilgrim jewellery online

    ReplyDelete

Google