METHOD:  Array::push

Array.push(element1, ..., elementN)

The push method is used to add one or more elements to an array, returning the new length of it. This affects the length of the array.

The following example creates an array 'trees' of two elements and then adds two more using the push method. The output from the second line of code will be "4":

Code:
trees = ["oak", "ash"]
document.write(trees.push("beech", "pear"))

Copyright 1999 by Infinite Software Solutions, Inc.
Trademark Information