Standard built-ins
String.prototype.trimEnd()
Removes ECMAScript whitespace and line terminators at the trailing edge without collapsing interior whitespace.
Formal Syntax & Structure
javascript syntaxjavascript
text.trimEnd()Return Value
String
Trimmed text.
Working Example
Example Snippetjavascript
console.log(JSON.stringify(" a ".trimEnd()));