concat( ) does not flatten nested arrays : Concat : Array Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Array » Concat »

 

concat( ) does not flatten nested arrays


 


package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var x:Array = [123];
        var y:Array = [[56][78]];
        var z:Array = x.concat(y);  // Result is [1, 2, 3, [5, 6], [7, 8]].
        
        trace(z)//1,2,3,5,6,7,8

    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Array
» Concat