I know that typeof (null) === "object", but I don't understand why this is acceptable in javascript. According to JavaScript data types and data structures over at MDN, null
is a primitive and yet according to their own Glossary;
A primitive (primitive value, primitive data type) is data that is not an object and has no methods. In JavaScript, there are 6 primitive data types: string, number, boolean, null, undefined, symbol (new in ECMAScript 2015).
a primitive must not be an object. I don't understand why this hasn't been fixed in later releases of javascript.