8. Types and Type(x)

2010-04-13

The specification uses a number of formal Types as part of the algorithms. Some Types are part of the language (called “Ecmascript Language Type”) and some are abstract or fictive (called “Specification Type”), to help explain behavioral details of the language. For instance, the Null type can be used from within Ecmascript (just null) whereas it is not possible to get a Reference Type (not the same as the reference to an object).

There are exactly six Language Types:
- Undefined
- Null
- Boolean
- String
- Number
- Object

And there are seven Specification Types:
- Reference
- List
- Completion
- Property Descriptor
- Property Identifier
- Lexical Environment
- Environment Record

Whenever the language mentions Type(x) it actually means “the type of x”, where “type” refers to one of the above types and “x” is some value.