Numeric value of 0 can be converted to a Boolean false, and any nonzero value will be converted to true : Boolean « Data Type « Flash / Flex / ActionScript






Numeric value of 0 can be converted to a Boolean false, and any nonzero value will be converted to true

 

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

        trace(Boolean(0));  // Displays: false
        trace(Boolean(1));  // Displays: true

    }
  }
}

        








Related examples in the same category

1.If you convert the string values of true and false, they will both convert to the Boolean true value because both string values are nonzero values