There are many programming languages where equality is a tricky subject, but JavaScript is really in a category of its own. This enlightening table by Milosz provides an eye-opening visualization of various equality comparisons in JS.

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.