[Chapter 21] Reference: JSObject.toString()
Author: David Flanagan
Date: Fri Aug 29 11:17:11 1997

#

| Chapter 21 JavaScript Reference |

# JSObject.toString() Java Method

## Name

JSObject.toString() Java Method---return the string value of a JavaScript object

## Availability

Part of the netscape.javascript package included with Navigator 3.0

## Synopsis

    public String toString()

### Arguments

none

### Returns

The string returned by invoking the `toString()` method of the JavaScript object represented by the specified Java JSObject.

## Description

The `toString()` method of the Java JSObject class invokes the JavaScript `toString()` method of the JavaScript object represented by a JSObject and returns the result of that method.

Because the Java `toString()` method of a JSObject simply invokes the JavaScript `toString()` method of the JavaScript object represented by that JSObject, Java is guaranteed to convert any JSObject to a string in the same way that JavaScript does.

## See Also

"JSObject", Chapter 19, LiveConnect: JavaScript and Java

JSObject.setSlot() |  | Link