User Guide
Array.pop() 109
Array.pop()
Availability
Flash Player 5.
Usage
my_array.pop() : Object
Parameters
None.
Returns
The value of the last element in the specified array.
Description
Method; removes the last element from an array and returns the value of that element.
Example
The following code creates the myPets_array array containing four elements, and then removes
its last element:
var myPets_array:Array = new Array("cat", "dog", "bird", "fish");
var popped:String = myPets_array.pop();
trace(popped); // displays fish
trace(myPets_array); // displays cat,dog,bird
See Also
Array.push(), Array.shift(), Array.unshift()