6.1.1 Operator is

The is operator appears in expressions of the form:

v is T

The is operator checks to see if the value on the left is a member of the type on the right. For user-defined types and most built-in types, is returns true if the value is an instance of a class that is or derives from the type on the right, otherwise it returns false. For built-in numeric types the result cannot be determined by the class of the value. The implementation must check the actual value to see if it is included in the value set of the type.

The following table shows the results of using various values and types with the is operator:

Value 

String

Number

int

uint

Boolean

Object

{}

false

false

false

false

false

true

"string"

true

false

false

false

false

true

"10"

true

false

false

false

false

true

null

false

false

false

false

false

false

undefined

false

false

false

false

false

false

true

false

false

false

false

true

true

false

false

false

false

false

true

true

0

false

true

true

true

false

true

1

false

true

true

true

false

true

-1

false

true

true

false

false

true

1.23

false

true

false

false

false

true

-1.23

false

true

false

false

false

true

NaN

false

true

false

false

false

true


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/specs/actionscript/3/as3_specification52.html