May 2001
Intermediate to advanced
720 pages
23h 24m
English
Array.pop( ) Method — remove the last element of an array
Flash 5
array.pop( )
The value of the last element of array,
which is also deleted.
The pop( ) method deletes the
last element of an array, reduces the
array’s length by 1, and returns the value
of the deleted element. Compare with the shift(
) method, which deletes the first
element of an array.
myList = new Array("one", "two", "three");
trace ("Now deleting " + myList.pop( )); // myList is now: ["one", "two"]
Array.push( ), Array.shift(
), Array.splice( ); “Removing
Elements from an Array” in Chapter 11,
“The delete Operator” in Chapter 5
Read now
Unlock full access