string.trimEnd()
removes whitespace from the end of a string
Links
Description of String.prototype.trimEnd() on MDN.
The specification describing `String.prototype.trimEnd()`.
The official tests for JavaScript (engines) for `trimStart`.
Blog post on the v8 blog.