# The String valueOf() method

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

Author: Flavio Copes | Published: 2019-03-12 | Canonical: https://flaviocopes.com/javascript-string-valueof/

Returns the string representation of the current String object:

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

Same as [`toString()`](https://flaviocopes.com/javascript-string-tostring/).
