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.
.trim() removes all whitespace characters: spaces, tabs (\t), and newlines (\n).
Challenge: Implement trimAll(str) that removes all surrounding whitespace including tabs and newlines.
trimAll('\t hello \n') // β 'hello'