C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




PUSH POP in javascript


Posted Date: 11 Oct 2008    Resource Type: Code Snippets    Category: Javascript

Posted By: Bindu Bujji       Member Level: Gold
Rating:     Points: 5



push() and pop() methods used to add and remove the elements of the Array.
These mehtods operate on the end of the Array.

USING PUSH

var friends = ["Rekha", "chandra"]
friends.push("Sastry");
alert(friends);



OUTPUT:
========
Rekha,chandra,Sastry
It adds the value at the end of the array.

USING POP.
The pop() method removes the last element and returns the element that is removed.


var friends =["Rekha",chandra","Sastry"];
var res = friends.pop();
alert(res);


OUTPUT:
======
Sastry

NOTE:Now the length of the array is decremented by 1.




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
PUSH AND POP in javascript  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: join() method in javascript
Previous Resource: Using shift and unshift to Add and Remove Elements using JavaScript
Return to Discussion Resource Index
Post New Resource
Category: Javascript


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use