Use pop( ) to remove the last element or shift( ) to remove the first element. : pop « Array « Flash / Flex / ActionScript






Use pop( ) to remove the last element or shift( ) to remove the first element.

 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var letters:Array = ["a", "b", "c", "d"];
        
        letters.splice(1, 1);
        for (var i:int = 0; i < letters.length; i++) {
            trace(letters [i]);
        }
    }
  }
}

        








Related examples in the same category

1.pop() is the antithesis of push( ): it removes the last element of an array
2.Removing the Last Element of an Array: use the pop() to remove the last element from an array.