unshift( )method adds one or more elements to the beginning of the array : Unshift : Array Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Array » Unshift »

 

unshift( )method adds one or more elements to the beginning of the array


 


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

        var versions:Array = new Array(  );
        versions[06;
        versions.unshift(5);      // versions is now [5, 6]
        versions.unshift(2,3,4);  // versions is now [2, 3, 4, 5, 6]
        
        trace(versions)// 2,3,4,5,6

    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Array
» Unshift