What is the push method?

Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.

What is the push method?

Rating:

The push method belongs to the Array object. This method is used to insert elements at the end of an array. A user can insert as many elements in an array as needed. A user can also insert an object with this method.

The syntaxes for using the push method are as follows:

array.push(value)
array.push(object)


The following example will demonstrate the use of the push method:

var myArray1=new Array("a","b","c")
var myArray2=new Array("f","g","h")
myArray1.push("d")
trace (myArray1)
myArray1.push(myArray2)
trace (myArray1)
//output: a,b,c,d
//output: a,b,c,d,f,g,h


Rating:



Other articles

Click here to Article home

 
uCertify.com | Our Company | Articles | Privacy | Security | Contact Us | News and Press Release | uCertify India
MCSE: MCSA, MCTS, MCITP    JAVA Certification: SCJP, SCWCD Cisco Certification: CCNA, CCENT, A+, Network+, Security+
Oracle Certification: OCP 9i, OCP 10g, OCA 9i, OCA 10g CIW foundation    EC-212-32    CISSP    Photoshop ACE    Adobe Flash ACE
© 2008 uCertify.com. All rights reserved. All trademarks are the property of their respective owners.