Sun Chili!Soft ASP Sun Chili!Soft
ASP Sun Microsystems

 

JScript Object toString Method

Returns a string representation of an object.

Syntax: JScript Object toString Method

objectname.toString( )

Arguments: JScript Object toString Method

objectname

An object for which a string representation is sought.

Remarks: JScript Object toString Method

The toString method is a member of all built-in JScript objects. How it behaves depends on the object type:

Object

Behavior

Array

Elements of an Array are converted to strings. The resulting strings are concatenated, separated by commas.

Boolean

If the Boolean value is True, returns "true". Otherwise, returns "false".

Function

Returns a string returned of the following form, where functionname is the name of the function whose toString method was called:

Function functionname( ) { [native code] }

Number

Returns the textual representation of the number.

String

Returns the value of the String object.

Default

Returns "[object objectname]", where objectname is the name of the object type.

Copyright 2002 Sun Microsystems, Inc. All rights reserved. Legal Notice.