wrapper object

An object created by new String, new Number or new Boolean that wraps a primitive value, and should not be used as a type.

In more detail

The capitalised String is the constructor function and its interface; the lowercase string is the primitive type. new String("a") is an object, so it compares differently and TypeScript will not assign it to string. Linters flag the capitalised names in annotations.

Related terms

Taught in

References