From 9a51e8ebb5d8300150bc2ce024f8ba38ccfc9efc Mon Sep 17 00:00:00 2001 From: Thomas Abbott <43638735+abbotttp@users.noreply.github.com> Date: Tue, 23 Oct 2018 08:48:40 +0100 Subject: [PATCH] fix: update JavaScript standard objects String.prototype.trimright stub article (#23170) * fix: update javascript standard objects String.prototype.trimright stub article * fix: method name, title, example and link text --- .../string/string-prototype-trimright/index.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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 664179ef0e6..80536babd7f 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)