Array.pop( ) Method | Flash 5 |
remove the last element of an array |
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 it 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( ); Section 11.8; Section 5.12.3