Array.shift()
Top  Previous  Next


SWiSH Player Support
SWF5 or later - Supported Internally

Syntax
arrayName.shift();

Arguments
None.

Returns
The first element from the specified array.

Description
Method; Removes the first element listed in the specified array and returns its value.

Samples
onLoad() {
    days = new Array("Sunday","Monday","Tuesday","Wednesday");
    trace(days.shift());
    // displays 'Sunday' in the debug window
    trace(days.shift()); 
    // displays 'Monday' in the debug window 
}



See also
Array.pop()