ToObject (Operator/internal)

An internal operator for converting values.

Availability:

ECMAScript edition - 2

This internal operator converts its input argument into an object.

The ToObject operator converts its input arguments according to the following table:

Input TypeResult
UndefinedGenerates a run-time error.
NullGenerates a run-time error.
BooleanCreate a new Boolean object whose default value is the input value.
NumberCreate a new Number object whose default value is the input value.
StringCreate a new String object whose default value is the input value.
ObjectNo conversion, the input value is returned unchanged.

See also:Cast operator, Conversion, Implicit conversion, Number, Type conversion

Cross-references:

ECMA 262 edition 2 - section - 9.9

ECMA 262 edition 3 - section - 9.9

http://cm.bell-labs.com/cm/cs/doc/90/4-10.ps.gz

http://cm.bell-labs.com/netlib/fp/dtoa.c.gz

http://cm.bell-labs.com/netlib/fp/g_fmt.c.gz