next up previous contents
Next: reverse Up: Methods Previous: pop   Contents


push

Description

Adds one or more elements to the end of an array and returns the array's new length.


Syntax

array1.push(value, ...)


Parameters

value
One or more values to append to the array.


Returns

The length of the new array. example:

a = new Array("a", "b", "c", "d");
trace(a.push("e", "f"));
//output: 6
trace(a);
//output: a,b,c,d,e,f




Copyright ©2000-2010 Shanghai TopCMM Software Technologies. All Rights Reserved.