Why is null considered an object in JavaScript?
Is checking
if ( object == null )
Do something
the
To add to the answer of What is the differrence between undefined and null, from JavaScript Definitive Guide 6th Edition, p.41 on this page:
You might consider
undefinedto represent system-level, unexpected, or error-like absense of value andnullto represent program-level, normal, or expected absence of value. If you need to assign one of these values to a variable or property or pass one of these values to a function,nullis almost always the right choice.