toString (Object - JavaScript)

Gets a string representation of an object.

Defined in

Object (JavaScript)

Syntax

toString() : string
Return value Description
string The string representation of the object.

Examples

This computed label displays the value of pi.
var o = new Object(Math.PI);
o.toString()