This post is another complementary one for my front-trends slides, about performances and security behind sth == null rather than classic sth === null || sth === undefined . I have already discussed about this in my JSLint: The Bad Part post but I have never gone deeper into this argument. Falsy Values In JavaScript, and not only JavaScript, we have so called falsy values. These are respectively: 0, null, undefined, false, "", NaN . Please note the empty string is empty, 'cause differently from php as example, "0" will be considered truish, and this is why we need to explicitly enforce a number cast, specially if we are dealing with input text value. In many other languages we may consider falsy values even objects such arrays or lists: <?php if (array()) echo 'never' ; ?> #python if []: print 'never' Above example will not work in JavaScript, since Array is still an instanceof Object. Another language that has falsy values is the ...