Instanceof Operator - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

Tests for the exact opposite of the equality (
, the result is
expression2
depends on the data types being compared:
Numbers, strings, and Boolean values are compared by value.
Objects, arrays, and functions are compared by reference.
Variables are compared by value or by reference depending on their type.
Availability: ActionScript 1.0; Flash Lite 1.0
Operands
expression1 :
Object
or function.
expression2 :
Object
or function.
Returns
- The Boolean result of the comparison.
Boolean
See also
!= inequality operator

instanceof operator

object instanceof classConstructor
Tests whether
object
. The
classConstructor
objects. For example, the following code returns
new String("Hello") instanceof String;
Whereas the following code returns false:
"Hello" instanceof String;
Availability: ActionScript 1.0; Flash Lite 2.0
Operands
- An ActionScript object.
object :
Object
classConstructor :
as
or
.
String
Date
154
ActionScript language elements
. As with the equality (
false
- A number, string, Boolean value, variable, object, array,
- A number, string, Boolean value, variable, object, array,
is an instance of
classConstructor
operator does not convert primitive types to wrapper
instanceof
- A reference to an ActionScript constructor function, such
Function
) operator. If
==
expression1
)operator, the definition of equal
==
or a subclass of
:
true
is equal to

Advertisement

Table of Contents
loading

Table of Contents