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(object)
The following example will demonstrate the use of the push method:
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:
Was this information helpful?
Other articles
- What is the for loop?
- What is the conditional expression?
- How to import an image on the Stage?
- Tip to draw a perfect circle or a square.
- Things to practice for Adobe test 9A0-311.