String.prototype.trimEnd

Returns a string where all whitespace characters have been removed from the end.

Syntax

trimEnd()

Return value

A string with trailing whitespace removed.

Examples

"  hello  ".trimEnd()
"  hello"