The concat( ) method combines two or more arrays into a single, new array: origArray.concat(elementList) : concat « Array « Flash / Flex / ActionScript






The concat( ) method combines two or more arrays into a single, new array: origArray.concat(elementList)

 


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

        var list1:Array = new Array(11, 12, 13);
        var list2:Array = list1.concat(14, 15);  // list2 becomes
        
        trace(list2); // 11,12,13,14,15

    }
  }
}

        








Related examples in the same category

1.Use concat to combine two arrays
2.concat( ) does not flatten nested arrays
3.Creating New Arrays from Existing Arrays