valueOf (String - JavaScript)

Gets the string as a primitive string.

Defined in

String (Standard - JavaScript)

Syntax

valueOf() : string
Return value Description
string The string value of this String object.

Examples

The following example prints the value of a String object as a string.
var cities = new String("Paris   Moscow   Tokyo");
cities.valueOf()