Possible Duplicate:
Null object in javascript
Hi, I’ve read this thread about null in JavaScript, but I’m very confused about the identity of null now.
As it is known that typeof(null) evaluates to object because of the language design error, and ECMA states that null is The Null Type.
8.2 The Null Type
The Null type has exactly one value, called null.
So why people keep saying that null is an object?
Someone said null is a singleton object. Is that how everybody sees the null as in JavaScript too?
Null is the absence of an object. Undefined means it hasn’t been assigned yet, and null means it has been assigned to be nothing.
Null is not really a singleton object, because dereferencing it will cause an error;
for (var x in null)will give you an error. Think back to the pointer days; null was the value a pointer had when it was not pointing to an object.