strict equality not just compares the value but the type also. I guess this
is more important when you rely on untyped variables, object.toString and
object.valueOf, as we did in AS1 and AS2. One situation, where strict
equality is used implicitely, is switch. At least this was the case in AS2.
It took people by surprise more than once, because normally AS2 converted
strings to numbers and vice versa when it made sense.
var value = "3";
switch( value )
{
case 3 : trace("we dont go here"); break;
default: trace("but here"); break;
}
if( value == 3 ) trace("this works in as2 at least because value is
converted to number.")
Cheers,
Ralf.
On 12/17/06, greg h <[EMAIL PROTECTED]> wrote:
http://livedocs.macromedia.com/flex/2/langref/operators.html#strict_equality
After reviewing the link above, please post back with any further
questions.
fyi ... I came to the link above as follows: In the Flex 2 Language
reference, in the top left frame, following below the package names is the
heading for "Language Elements" one of which is "Operators" The link above
is from the "Operators" page.
Flex 2 Language reference of course being this link:
http://livedocs.macromedia.com/flex/2/langref/
hth,
g
On 12/16/06, Lachlan Cotter <[EMAIL PROTECTED]> wrote:
>
> Can anybody point me to a comprehensive reference that explains how
> equality and strict equality works in ActionScript 3. Presumably
> strict equality means two variables hold the exact same instance. How
> is non-strict equality determined with non-primitive objects,
> collections and the like?
>
> Cheers,
> Lach
>
--
Ralf Bokelberg <[EMAIL PROTECTED]>
Flex & Flash Consultant based in Cologne/Germany