Array.pop()

Availability

Flash Player 5.

Usage

my_array.pop()

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 containing four elements, then removes its last element.

myPets = ["cat", "dog", "bird", "fish"];
popped = myPets.pop();
trace(popped);
// returns fish