diff --git a/guide/english/javascript/standard-objects/string/string-prototype-trimright/index.md b/guide/english/javascript/standard-objects/string/string-prototype-trimright/index.md index 664179ef0e..80536babd7 100644 --- a/guide/english/javascript/standard-objects/string/string-prototype-trimright/index.md +++ b/guide/english/javascript/standard-objects/string/string-prototype-trimright/index.md @@ -1,15 +1,17 @@ --- -title: String.prototype.trimright +title: String.prototype.trimRight --- -## String.prototype.trimright +## String.prototype.trimRight -This is a stub. Help our community expand it. +The `trimRight()` function removes any whitespace characters from the end (the right side) of a given string. It returns a new string. It does not modify the original string. -This quick style guide will help ensure your pull request gets accepted. +Examples: +```js +" This string has two spaces at the beginning and a tab and two spaces at the end. ".trimRight(); +// output: " This string has two spaces at the beginning and a tab and two spaces at the end." +``` - +`trimRight()` removes any whitespace character, not just spaces or tabs. #### More Information: - - - +- [String.prototype.trimRight() on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimEnd)