For example, null is a member of type Array as well as type Function , but neither Array nor Function is a subtype of the other. On the other hand, a variable does have a particular type. If one declares a variable x of type Array , then whatever value is held in x is guaranteed to have type Array , and one can assign any value of type Array to x . User-defined type names do not have to follow this convention. Unlike in JavaScript 1.x, there is no distinction between objects and primitive values.
All values can have methods.
Some values can be sealed, which disallows addition of ad-hoc properties. User-defined classes can be made to behave like primitives. The above type names are not reserved words. They are considered to be defined in a scope that encloses a package's global scope, so a package could use these type names as identifiers. The names Boolean , Number , and String have been deliberately left unused to enable implementations to use them to emulate the behavior of the JavaScript 1.x Boolean , Number , and String wrapper objects.