!== (strict inequality)
Availability
Flash Player 6.
Usage
expression1 !== expression2
Parameters
None.
Returns
A Boolean value.
Description
Operator; tests for the exact opposite of the strict equality (
operator performs the same as the inequality operator except that data types are not converted.
For more information, see "Automatic data typing" in Using ActionScript in Flash. If
is equal to
expression2
equality (
) operator, the definition of equal depends on the data types being compared, as
===
illustrated in the following list:
•
Numbers, strings, and Boolean values are compared by value.
•
Objects, arrays, and functions are compared by reference.
•
A variable is compared by value or by reference, depending on its type.
For more information, see "Operator precedence and associativity" in Using ActionScript in Flash.
Example
The comments in the following code show the returned value of operations that use the equality
(
), strict equality (
==
var s1:String = "5";
var s2:String = "5";
var s3:String = "Hello";
var n:Number = 5;
var b:Boolean = true;
trace(s1 == s2); // true
trace(s1 == s3); // false
trace(s1 == n);
trace(s1 == b);
trace(s1 === s2); // true
trace(s1 === s3); // false
trace(s1 === n);
trace(s1 === b);
trace(s1 !== s2); // false
trace(s1 !== s3); // true
32
Chapter 2: ActionScript Language Reference
, and their data types are equal, the result is
), and strict inequality (
===
// true
// false
// false
// false
) operator. The strict inequality
===
false
) operators:
!==
expression1
. As with the strict
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?