Skip to content
FLAVIO COPES
flaviocopes.com

The String toString() method

By

Learn how the JavaScript toString() method returns the primitive string representation of a String object, working just like the valueOf() method does.

~~~

Returns the string representation of the current String object:

const str = new String('Test')
str.toString() //'Test'

It’s same as valueOf().

~~~

Related posts about js: