String.prototype.trimbeginner' hello '.trim() // β 'hello'
'
text '.trim() // β 'text'
'no spaces'.trim() // β 'no spaces'Use trim() to remove all leading and trailing whitespace characters from a string.
If the string has no leading or trailing whitespace, .trim() returns an equivalent string.
Challenge: Implement trimClean(str) and verify it works on clean strings.
trimClean('hello') // β 'hello'