String.prototype.toString

Returns a string representation of a string.

Syntax

toString()

Return value

A string.

Examples

"hello".toString()
"hello"
let s1 = new String("hello")
print(s1, typeof s1)
let s2 = s1.toString()
print(s2.toString(), typeof s2)
/* PRINTS
hello object
hello string
*/