The shift( ) method removes the first element of the array and returns its value. : shift « Array « Flash / Flex / ActionScript






The shift( ) method removes the first element of the array and returns its value.

 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){

        var letters:Array = ["a", "b", "c", "d"];
             
        trace(letters.shift(  ));
    }
  }
}

        








Related examples in the same category

1.shift( ) removes an element from the beginning of an array: theArray.shift( )
2.Removing the First Element of an Array: shift() method removes the element from the beginning of the array.