JS: String.prototype.trimEnd
(new in ECMAScript 2019)
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");