JSREF

JavaScript String trimEnd()

The trimEnd() method removes whitespace from the end of a string.