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: Push Function



Push Function:
Adds one or more elements to the end of an array and returns the last element added to the array. This method changes the length of the array.

Syntax:
arrayname.push("element1","element2",.......,"elementN")

Description:
The behavior of the push method is analogous to the push function in Perl 4. Note that this behavior is different in Perl 5.


Example in HEAD Section:

<html>
<head>
<title>Push Function</title>
<script language="javascript">
myfish=new Array("Elephent", "Lion" , "Tiger" , "Cat" , "Dog");
document.write("<b>Before my Array is:</b> " +myfish +"<br>");
document.write("<b>Total element in the Array is:</b> " + myfish1.push("Mouse"));
document.write("<br><b>After my Array is:</b> " +myfish);
</script>
</head>
</html>


Example in BODY Section:

<html>
<head>
<title>Push Function</title>
</head>
<body>
<script language="javascript">
myfish=new Array("Elephent", "Lion" , "Tiger" , "Cat" , "Dog");
document.write("<b>Before my Array is:</b> " +myfish +"<br>");
document.write("<b>Total element in the Array is:</b> " + myfish1.push("Mouse"));
document.write("<br><b>After my Array is:</b> " +myfish);
</script>
</body>
</html>



OUTPUT:

Before my Array is: Elephent,Lion,Tiger,Cat,Dog
Total element in the Array is: 6
After my Array is: Elephent,Lion,Tiger,Cat,Dog,Mouse

17 comments:

  1. Hey there,
    Am utilizing Hp LaserJet 1018 printer for my Mac publication expert In
    fact am used windows xp formerly to my unit.
    Now it is updated with Mac OS X Snow leopard.

    Below is a complication is that the tool is not able feature well with the unit.



    Review my homepage :: xerox phaser 8560 manual

    ReplyDelete
  2. Hi Hadar,
    nice project! Why do you use the low shrinkage steel for Bronze
    XT shrinks by 28%?

    Feel free to surf to my web blog: stalkerfrance.com

    ReplyDelete
  3. WOW what precisely I'm seeking. Came here by searching for online associates degree nursing

    Also visit my website ,cheap earrings for women uk

    ReplyDelete
  4. Exсellent wаy of explainіng, anԁ pleaѕant pагagгaph to get infοrmatiоn оn the topiс of my presеntatіоn subјеct, ωhich i am going to сοnvey in college.


    Αlso νisіt mу page; facebοοκ
    help (http://mondov.com/__media__/js/netsoltrademark.php?d=yibster.com)

    ReplyDelete
  5. sir, please send me the video.

    Have a look at my webpage :: xerox phaser 8560 color printer

    ReplyDelete
  6. The earrings looks so trendy and wonderful the building of earrings really sounds good information beautiful share.
    Keep posting!

    Feel free to visit my blog - ,Cheap silver earrings uk

    ReplyDelete
  7. Hello, i think that i saw you visited my blog so i came to “return the favor”.
    I'm trying to find things to improve my site!I suppose its ok to use some of your ideas!!

    Here is my web site; xerox 8560 part numbers

    ReplyDelete
  8. Simply desire to say your article is as astounding.
    The clearness to your put up is just great and
    that i could think you're a professional on this subject. Fine together with your permission allow me to grab your feed to keep updated with approaching post. Thank you 1,000,000 and please keep up the rewarding work.

    Feel free to visit my site :: rosacea

    ReplyDelete
  9. They do everything necessary to make unsecured business loans that
    decision. If unsecured business loans you market yourself
    correctly, you wikll become better. Goodness, no
    oone can be all things to all people and it's the same thing for a
    while, thank you.

    my page ... business courier cincinnati

    ReplyDelete
  10. With havin so much content do you ever run into any issues of
    plagorism or copyright infringement? My website has a lot of completely
    unique content I've either written myself or outsourced but it appears a lot of it is popping it up all over the web without my agreement.
    Do you know any methods to help reduce content from being ripped
    off? I'd genuinely appreciate it.

    Feel free to visit my web blog - How can you with Magic Submitter

    ReplyDelete
  11. Then you can certainly have baby games that function scavenger hunts.
    Ask the kids to create special dishes to type or
    your home and offer a special vampire name to each dish.



    Check out my webpage - baby hazel games [nichost.ru]

    ReplyDelete
  12. Having iPhone Game Iphone app Developers India for the relief,
    there is not any wastage of time that you simply
    otherwise dedicate to training the particular in-house employees for each and every technical need.
    It preserves time by employing iPhone Developers Indian and that time frame works extremely well within enhancing
    and improving upon the business tips.

    my site; castle clash hack tool

    ReplyDelete
  13. It's an remarkable article for all the online people; they
    will get advantage from it I am sure.

    Also visit my web site; www.howtosetupawebsiteeasily.info

    ReplyDelete
  14. Athletes are սsually skilled to jump greater or run morе rapidly, similar to singers may be
    taught to sing more beneficial. The object of the Islаnd Flyover event is
    to locate “i Рoints” hidden all oνer the island.

    He gets a good amount of experience lining up at receiѵer аnd has shown a strong knack for utilizing his big vertical leap
    to pull in questionable passes.

    Feel free to visit my page ... 50 inch vertical jump program

    ReplyDelete
  15. Write more, thats all I have to say. Literally, it seems as
    though you relied on the video to make your point.
    You obviously know what youre talking about, why throw
    away your intelligence on just posting videos to
    your weblog when you could be giving us something informative to read?



    My homepage ... how to replace car keys

    ReplyDelete
  16. Hello! Do you know if they make any plugins to safeguard
    against hackers? I'm kinda paranoid about losing everything I've
    worked hard on. Any suggestions?

    Also visit my homepage :: cheap Polaris snowmobile parts

    ReplyDelete

Google