JS: String.prototype.trimEnd

By Xah Lee. Date: . Last updated: .

New in JS2019.

str.trimEnd()
same as trimRight
str.trimRight()
Return a new string with whitespaces on the right removed. [see Whitespace Characters]
console.log("t  ".trimEnd() === "t");
console.log("t  ".trimRight() === "t");
BUY ΣJS JavaScript in Depth