Operators > != (inequality)
!= (inequality)Syntax
expression1
!=
expression2
Arguments
expression1, expression2
Numbers, strings, Booleans, variables, objects, arrays, or functions.
Description
Operator (equality); tests for the exact opposite of the ==
operator. If expression1
is equal to expression2
, the result is false
. As with the ==
operator, the definition of equal depends on the data types being compared.
![]() |
Numbers, strings, and Boolean values are compared by value. |
![]() |
Variables, objects, arrays, and functions are compared by reference. |
Player
Flash 5 or later.
Example
The following example illustrates the results of the !=
operator.
5 != 8
returns true
5 != 5
returns false
The following example illustrates the use of the !=
operator in an if
statement:
a = "David";
b = "Fool"
if (a != b){
trace("David is not a fool");
}
See also
== (equality)