splice( ) can both remove elements from and add elements to an array.
package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
var letters:Array = ["a", "b", "c", "d", "e", "f"];
letters.splice(1, 3);
letters.splice(1);
trace(letters); // a
}
}
}
Related examples in the same category