- 4.3
Definitions
-
The following are informal definitions of key terms associated
with ECMAScript.
- 4.3.1 Type
A type is a set of data values.
- 4.3.2 Primitive Value
A primitive value is a member of one of the types
Undefined, Null, Boolean, Number, or String. A
primitive value is a datum that is represented directly at the
lowest level of the language implementation.
- 4.3.3 Object
An object is a member of the type Object.
It is an unordered collection of properties each of which contains
a primitive value, object, or function. A function stored in a
property of an object is called a method.
- 4.3.4 Constructor
A constructor is a Function object that creates
and initialises objects. Each constructor has an associated
prototype object that is used to implement inheritance and shared
properties.
- 4.3.5 Prototype
A prototype is an object used to implement
structure, state, and behaviour inheritance in ECMAScript. When a
constructor creates an object, that object implicitly references
the constructor's associated prototype for the purpose of resolving
property references. The constructor's associated prototype can be
referenced by the program expression
constructor.prototype, and properties added to an
object's prototype are shared, through inheritance, by all objects
sharing the prototype.
- 4.3.6 Native Object
A native object is any object supplied by an
ECMAScript implementation independent of the host environment.
Standard native objects are defined in this specification. Some
native objects are built-in; others may be constructed during the
course of execution of an ECMAScript program.
- 4.3.7 Built-in Object
A built-in object is any object supplied by an
ECMAScript implementation, independent of the host environment,
which is present at the start of the execution of an ECMAScript
program. Standard built-in objects are defined in this
specification, and an ECMAScript implementation may specify and
define others. Every built-in object is a native object.
- 4.3.8 Host Object
A host object is any object supplied by the host
environment to complete the execution environment of ECMAScript.
Any object that is not native is a host object.
- 4.3.9 Undefined Value
The undefined value is a primitive value used when
a variable has not been assigned a value.
- 4.3.10 Undefined Type
The type Undefined has exactly one value, called
undefined.
- 4.3.11 Null Value
The null value is a primitive value that
represents the null, empty, or non-existent reference.
- 4.3.12 Null Type
The type Null has exactly one value, called
null.
- 4.3.13 Boolean Value
A boolean value is a member of the type
Boolean and is one of two unique values, true and
false.
- 4.3.14 Boolean Type
The type Boolean represents a logical entity and consists
of exactly two unique values. One is called true and the
other is called false.
- 4.3.15 Boolean Object
A Boolean object is a member of the type
Object and is an instance of the built-in Boolean object.
That is, a Boolean object is created by using the Boolean
constructor in a new expression, supplying a
boolean as an argument. The resulting object has an implicit
(unnamed) property that is the boolean. A Boolean object can be
coerced to a boolean value.
- 4.3.16 String Value
A string value is a member of the type
String and is a finite ordered sequence of zero or more
16-bit unsigned integer values.
NOTE
Although each value usually represents a single 16-bit unit of
UTF-16 text, the language does not place any restrictions or
requirements on the values except that they be 16-bit unsigned
integers.
- 4.3.17 String Type
The type String is the set of all string values.
- 4.3.18 String Object
A String object is a member of the type
Object and is an instance of the built-in String object.
That is, a String object is created by using the String constructor
in a new expression, supplying a string as an
argument. The resulting object has an implicit (unnamed) property
that is the string. A String object can be coerced to a string
value by calling the String constructor as a function (15.5.1).
- 4.3.19 Number Value
A number value is a member of the type
Number and is a direct representation of a number.
- 4.3.20 Number Type
The type Number is a set of values representing numbers.
In ECMAScript, the set of values represents the double-precision
64-bit format IEEE 754 values including the special "Not-a-Number"
(NaN) values, positive infinity, and negative infinity.
- 4.3.21 Number Object
A Number object is a member of the type
Object and is an instance of the built-in Number object.
That is, a Number object is created by using the Number constructor
in a new expression, supplying a number as an
argument. The resulting object has an implicit (unnamed) property
that is the number. A Number object can be coerced to a number
value by calling the Number constructor as a function (15.7.1).
- 4.3.22 Infinity
The primitive value Infinity represents the positive
infinite number value. This value is a member of the Number
type.
- 4.3.23 NaN
The primitive value NaN represents the set of IEEE
Standard "Not-a-Number" values. This value is a member of the
Number type.