Can someone help me understand how could the following statements true in javascript:
null == nulltruenull === nulltrue
when typeof null is object and since objects are reference type and no two object can have same address space and can't be equal in both the cases then how it could be true
nullis a primitive value, not an objecttypeof null === "object": developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/… It's rather a bug.nullisn't really an object. It's a historical accident thattypeof null == 'object'nullwas an actual object, why do you assume thatnull === nulldoes not compare that singleton null object with itself?