User Guide

82 Chapter 2: ActionScript Language Reference
var y:String = "steve";
trace(x == y); // output: false
The following examples show comparison by reference. The first example compares two arrays
with identical length and elements. The equality operator will return
false for these two arrays.
Although the arrays appear equal, comparison by reference requires that they both refer to the
same array. The second example creates the
thirdArray variable, which points to the same array
as the variable
firstArray. The equality operator will return true for these two arrays because
the two variables refer to the same array.
var firstArray:Array = new Array("one", "two", "three");
var secondArray:Array = new Array("one", "two", "three");
trace(firstArray == secondArray); // will output false
// Arrays are only considered equal
// if the variables refer to the same array.
var thirdArray:Array = firstArray;
trace(firstArray == thirdArray); // will output true
See also
! (logical NOT), != (inequality), !== (strict inequality), && (logical AND), || (logical OR), ===
(strict equality)