This internal operator converts its input argument into an object.
The ToObject operator converts its input arguments according to the following table:
Input Type | Result |
Undefined | Generates a run-time error. |
Null | Generates a run-time error. |
Boolean | Create a new Boolean object whose default value is the input value. |
Number | Create a new Number object whose default value is the input value. |
String | Create a new String object whose default value is the input value. |
Object | No conversion, the input value is returned unchanged. |
See also: | Cast operator, Conversion, Implicit conversion, Number, Type conversion |
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
Prev | Home | Next |
ToNumber | Up | toolbar |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |