EasyManua.ls Logo

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT - Page 261

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT
816 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
=== (strict equality) 261
=== (strict equality)
Availability
Flash Player 6.
Usage
expression1 === expression2
Returns
A Boolean value.
Description
Operator; tests two expressions for equality; the strict equality operator performs just like the
equality operator except that data types are not converted. The result is
true if both expressions,
including their data types, are equal.
The definition of equal depends on the data type of the parameter:
Numbers and Boolean values are compared by value, and are considered equal if they have the
same value.
String expressions are equal if they have the same number of characters and the characters
are identical.
Variables, objects, arrays, and functions are compared by reference. Two variables are equal if
they refer to the same object, array, or function. Two separate arrays are never considered equal,
even if they have the same number of elements.
Example
The following code displays the returned value of operations that use the equality, strict equality,
and strict inequality operators.
s1 = new String("5");
s2 = new String("5");
s3 = new String("Hello");
n = new Number(5);
b = new Boolean(true);
s1 == s2; // true
s1 == s3; // false
s1 == n; // true
s1 == b; // false
s1 === s2; // true
s1 === s3; // false
s1 === n; // false
s1 === b; // false
s1 !== s2; // false
s1 !== s3; // true
s1 !== n; // true
s1 !== b; // true
See also
== (equality)
, != (inequality), === (strict equality)

Table of Contents

Related product manuals