

The difference between undefined and null in Javascript - rantfoil
http://saladwithsteve.com/2008/02/javascript-undefined-vs-null.html

======
axod
Nice clear up, but still wrong/bad... The author swaps one problem for
another.

When people write

if (foo==null)

OR

if (!foo)

To check if something exists, they really meant to write

if ((typeof foo)=='undefined')

You can't check for a property existing by coercing into a boolean. That's
horrible. What if it does exist, and holds a boolean.

~~~
LogicHoleFlaw
I like the way Lua does it, where "null" and "undefined" are the same concept,
and represented by nil. I don't know if that could be done in Javascript
though due to the difference between variable access and property access.

