String.prototype.trimEndbeginner' hello '.trimEnd() // β ' hello'
'text '.trimEnd() // β 'text'
'hi'.trimEnd() // β 'hi'Use trimEnd() to remove only trailing whitespace from the end of a string, leaving leading whitespace intact.
A string without trailing whitespace is returned unchanged by trimEnd().
Challenge: Implement verifyTrimEnd(str) using trimEnd.
verifyTrimEnd('hello') // β 'hello'