when is stricly equal not equal?
at the end of a lengty debugging session, I have this situation
public dynamic class AA extends Array
{
public function close():void
{ this[this.length-1] = this[0]; // if the array describes a circular structure, the last element definitely should be the first one
}
}
the AA class members are, by design, instances of class A (or possibly A2 that extends A). In this case, they are definitely
class A
I call close(), and later verify that the first and last still seem to be identical (at least as far as A's toString() traces out)
In a different part of the program, I have
var aa:AA = ....
for(var i:int = 0 ; i < aa.length ; i++)
{ var a:A = aa;
if(i != 0 && a == aa[0])
break; // ignore last element if it happens to be the "end" of a ring, rather than a chain
}
the == returned false.....
When I changed the code to use ===, the comparison returned true as expected.
Of course, both == and === define object equality the same way. So, what could be the difference?