May 2001
Intermediate to advanced
720 pages
23h 24m
English
Array.shift( ) Method — remove the first element of an array
Flash 5
array.shift( )
The value of the first element of array,
which is also deleted.
The shift( ) method deletes the
first element of an array and then moves all the
remaining elements of the array up one position. The affected
array’s length is reduced by 1. Note that
shift( ) differs from the pop(
) method, which deletes the last
element of an array.
myList = new Array ("a", "b", "c");
myList.shift( ); // myList becomes ["b", "c"]
Array.pop( ), Array.splice(
), Array.unshift( ); “Removing
Elements from an Array” in Chapter 11
Read now
Unlock full access