Object Constructor
|
Object([arg]) |
Converts arg to an object. |
new Object([arg]) |
Creates a new object. |
Object Instance
|
toString() |
Returns the string representation of the object. |
valueOf() |
Returns the value of the object. |
toSource() |
Returns a script describing how to remake the object. |
Converts arg to an object.
Type |
Result |
undefined |
new Object() |
null |
new Object() |
boolean |
new Boolean(arg) |
string |
new String(arg) |
number |
new Number(arg) |
obj |
arg |
Creates a new object. If arg is null or
missing, creates a new object, otherwise it converts arg
to an object as Object(arg)
Returns the string representation of the object.
Descendents of Object redefine this function. For
example, the Array object uses the
toJoin function.
The default representation is '[object Object]'
Returns the value of the object.
Normal objects return the object itself.
Wrapped objects, e.g. a boolean created by
new Boolean(true) , return the wrapped value.
toSource()
| JavaScript 1.3 |
Returns a script describing how to remake the object.
Descendents of Object typically redefine this function.
Returns an object literal consisting of the object's enumerable
properties.
a = {a:3, b:7, c:9}
a[3] = "asdf"
a.toSource()
|
{a:3, b:7, c:9, 3:"asdf"}
|
Copyright © 1998-2000 Caucho Technology. All rights reserved.
Last modified: Fri, 31 Mar 2000 18:53:11 -0800 (PST)
|