Douglas Crockford describes the “==” and “!=” operators as the “evil twins” of the more-specific “===” and “!==” operators. The former set will make necessary type coersions before evaluating, but the latter set is more judicious, requiring that objects be of the same type to be equal.
While triple-equals and I are fast friends, I’ve found that remembering to use “!==” as opposed to “!=” comes less naturally to me. It’s this habit and a few others that are beginning to convince me I might benefit from the use of a tool like JSLint.
blog comments powered by Disqus