diff --git a/guide/english/javascript/standard-objects/string/string-prototype-tostring/index.md b/guide/english/javascript/standard-objects/string/string-prototype-tostring/index.md index f3e496ac22..07a829ec54 100644 --- a/guide/english/javascript/standard-objects/string/string-prototype-tostring/index.md +++ b/guide/english/javascript/standard-objects/string/string-prototype-tostring/index.md @@ -3,13 +3,18 @@ title: String.prototype.toString --- ## String.prototype.toString -This is a stub. Help our community expand it. +The `toString()` method returns a primitive string representing the given String object. -This quick style guide will help ensure your pull request gets accepted. +**Example** +```js +var x = new String("hi"); +console.log(x); // String {"hi"} +console.log(typeof x); // object +console.log(x.toString()); // hi +console.log(typeof x.toString()); // string +``` - +*Note*: for String objects, `toString()` and `valueOf()` return the same thing. #### More Information: - - - +- [String.prototype.toString() on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toString)