toString (String - JavaScript)

Gets the string representation of a String object.

Defined in

String (Standard - JavaScript)

Syntax

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

Examples

The following example gets the string representation of a String object.
cities = new String("Paris   Moscow   Tokyo");
cities.toString()