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