JS: String.prototype.trimEnd

By Xah Lee. Date: . Last updated: .

(new in ECMAScript 2019)

str.trimEnd()
same as trimRight
str.trimRight()

Return a new string with whitespaces on the right removed.

console.assert("t  ".trimEnd() === "t");
console.assert("t  ".trimRight() === "t");