Type (Definition)

The ECMA 262 standard defines nine data types. A type is a set of data values.

Availability:

ECMAScript edition - 2

A value is an entity that can take on the personality of one of the implemented data types. Some types are reserved for internal use and are not generally made visible to the script developer although this may be implementation-dependent and they might be visible with a debugger.

The ECMA 262 standard defines nine data types. The host environment may add others depending on what it needs. The various types are listed in the table, which indicates whether they are special internal types:

Type NameDescription
AggregateA collection of atomic types assembled collectively into an object.
ArithmeticAll types that yield a value that can be operated on numerically.
ArrayCollections of objects and identifiers assembled into a sequence.
BasicThe fundamental simple, non-object types.
BooleanThis type can store and yield true or false values.
CompletionUsed only as the intermediate result of expression evaluations and cannot be stored in object properties.
ListUsed only as the intermediate result of expression evaluations and cannot be stored in object properties.
NullThis has exactly one value, null, and is distinct from undefined.
NumberInteger and floating point values are all stored in a generic number type.
ObjectAn object is an unordered collection of properties. Each property consists of a name, a value and a set of attributes.
ReferenceUsed only as the intermediate result of expression evaluations and cannot be stored in object properties.
ScalarThe non-object types.
StringStrings are arrays of characters which are accessible individually by indexing their position in the sequence.
UndefinedThis value is returned by variables that have not yet been assigned a value.

Warnings:

See also:Aggregate type, Boolean, Cast operator, Completion type, const, enum, Identifier, int, List type, Logical operator, null, Number, Object, Reference, Scalar type, String, undefined type

Cross-references:

ECMA 262 edition 2 - section - 4.3.1

ECMA 262 edition 2 - section - 8

ECMA 262 edition 3 - section - 4.3.1

ECMA 262 edition 3 - section - 8