News for hackers. Stuff that matters.
Re:Node.js is Cancer by ootachi on Sunday October 02, 2011 @04:40AM (#3062390)
Right, it doesn't work when you're testing whether foo is a bound name at all. In that case you need to use "window.foo" (or this.foo in Node).

And yeah, it's double equals. The coercion is exactly what allows "== null" to do the right thing in the presence of undefined. Contrary to popular belief, "0 == null", "'' == null", and "[] == null" are all false in JavaScript. "foo == null" doesn't test for falsiness, it just checks whether foo is null or undefined.

There are no comments on this comment yet.