Name

String.toString( ) — return the string

Availability

JavaScript 1.0; JScript 1.0, ECMAScript v1 Overrides Object.toString( )

Synopsis

                  string.toString(  )

Returns

The primitive string value of string. It is rarely necessary to call this method.

Throws

TypeError

If this method is invoked on an object that is not a String.

Get JavaScript: The Definitive Guide, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.