Inequality Operator - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

The following example illustrates comparison by reference with two functions:
var a:Function = function() { trace("foo"); };
var b:Function = function() { trace("foo"); };
a(); // foo
b(); // foo
trace(a != b); // true
a = b;
a(); // foo
b(); // foo
trace(a != b); // false
// trace statement output: foo foo true foo foo false
The following example illustrates comparison by reference with two arrays:
var a:Array = [ 1, 2, 3 ];
var b:Array = [ 1, 2, 3 ];
trace(a); // 1, 2, 3
trace(b); // 1, 2, 3
trace(a!=b); // true
a = b;
trace(a); // 1, 2, 3
trace(b); // 1, 2, 3
trace(a != b); // false
// trace statement output: 1,2,3 1,2,3 true 1,2,3 1,2,3 false
See also
! logical NOT operator
,
operator
|| logical OR operator
operator
<> inequality operator
expression1 <> expression2
Deprecated since Flash Player 5. This operator has been deprecated. Macromedia
recommends that you use the
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 Player 2
,
!== strict inequality operator
,
== equality operator
!= (inequality)
) operator. If
==
. As with the equality (
false
,
&& logical AND
,
=== strict equality
operator.
expression1
)operator, the definition of equal
==
is equal to
Operators
167

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF