Is element in an array undefined : Array Declaration : Array Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Array » Array Declaration »

 

Is element in an array undefined


 

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

        var numbers:Array = new Array(410);
        numbers[41;
        trace(numbers);  
        for(var i:int 0; i < numbers.length; i++) {
          if(numbers[i== undefined) {
            numbers.splice(i, 1);
            i--;
          }
        }
        trace(numbers);  
    }
  }
}
// 4,10,,,1
// 4,10,1

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Array
» Array Declaration