# The String toString() method

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

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2019-03-07 | Topics: [JavaScript](https://flaviocopes.com/tags/js/) | Canonical: https://flaviocopes.com/javascript-string-tostring/

Returns the string representation of the current String object:

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

It's same as [`valueOf()`](https://flaviocopes.com/javascript-string-valueof/).
