Convert undefined to Number : Type cast « Data Type « Flash / Flex / ActionScript






Convert undefined to Number

 


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

        trace(int(undefined)); //0

    }
  }
}

        








Related examples in the same category

1.Use int() method to convert float number to integer
2.Use int() method to convert boolean value to integer
3.Convert null to number