|
|
|
|
|
by afiori
1704 days ago
|
|
typeof null should be "null", just how typeof undefined is "undefined" it is an implementation bug of netscape, null was represented by the zero pointer and objects where tagged pointer with a tag of zero, so when reading its tag null looked like an object. there are solutions as x == null, x === null, and Object(x) == x allow you to check for null|undefined, null, and object values, but typeof null being "object" is purely a specification bug that it is too late to change. |
|