String.constructor

The String constructor.

Syntax

new String(value?)
String(value?)

Note

When called with new, returns a String object, which is not a primitive.

Parameters

A value to be converted to a string.

Examples

String(123)
"123"
typeof String("example")
"string"
typeof new String("example")
"object"