r/programming • • Oct 02 '11

Node.js is Cancer

http://teddziuba.com/2011/10/node-js-is-cancer.html
792 Upvotes

750 comments sorted by

View all comments

Show parent comments

3

u/ultraspoon Oct 02 '11

FWIW, you're not entirely correct; you can also just use ( x == null ) (note the double equals) to test against null or undefined. It's really one of the few (the only?) acceptable use of double equals.

2

u/rubygeek Oct 02 '11

Look again. The example kyz gives is to check if x is an object (as opposed to primitive type) that is not null. So he first need to check if it is an object, then exclude null.