I'm wondering if I should always use "===" (strict equality) when doing equality checks... Is there any example of when it is preferable to use "==" (non-strict equality)? In particular, should:
if (param1 == null || param1.length == 0)
be
if (param1 === null || param1.length === 0)
?
What about with things like strings? param1 == "This is a String."
I don't actually know much about ActionScript, but I believe it's EMCAScript compliant which means my JavaScript knowledge would be relevant.
In JavaScript, if you're willing to embrace explicit typing (this means never do
"something" + 5
, always be explicit in your types e.g."something" + String(5)
), if you embrace that approach there's actually never an instance where == is preferred to ===.