Am I right in thinking that comparing a string to null will work but a number
will fail?
var str:String = "A lovely string";
var num:Number = 101;
if (str == null) { // This'll be ok
Alert.show("I am not a string!");
}
if (num == null) { // This'll coke!
Alert.show("I am not a number, I'm a free man!");
}
Seems odd one will work and one won't.
Is it because a null can be implicitly converted to the string "null" and a
number can't?
Thanks for any insight.
Adrian