Of the five primitive JavaScript data types (string, number, boolean, null and undefined), the first three have associated constructors:
new String("Hello!")
new Number(40)
new Boolean(true)
The constructed objects are wrappers for the object literals. In particular, new String("Hello!") === "Hello!" evaluates to false.
Are there a similar constructors for the null and undefined primitive data types that produce object wrappers different from the corresponding object literal?
No, there are not, and it wouldn’t make sense considering the “values” they represent.
Ignore the fact that typeof null === ‘object’
According to MDN:
The interpreter just does some magical auto-wrapping of primitive in classes if you call a method that affects the primitive, like
charAt.