String.prototype.trimStartbeginner' hello '.trimStart() // β 'hello '
' text'.trimStart() // β 'text'
'hi'.trimStart() // β 'hi'Use trimStart() to remove only leading whitespace from the beginning of a string, leaving trailing whitespace intact.
When both leading and trailing whitespace exist, trimStart() leaves the trailing intact.
Challenge: Implement keepTrailing(str) using trimStart.
keepTrailing(' hello ') // β 'hello '