caucho
Resin 1.1
FAQ
Reference
JavaDoc
Demo
Java Tutorial

Getting Started
Configuration
Servlet
JSP
XTP/XSL
JavaScript
JS Library

Core Library
File Library
Servlet Library
Database Library
XML Library

Global
Object
Array
Boolean
Date
Function
Math
Number
Regexp
String
 The Object Object

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.

Object Constructor

Object([arg])

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

new Object([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)

Object Instance

toString()

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]'

valueOf()

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"}

Global   Array
Copyright © 1998-2000 Caucho Technology. All rights reserved.
Last modified: Fri, 31 Mar 2000 18:53:11 -0800 (PST)