originalStringtrimStarttrimEnd
The Javascript string methods trimStart and trimEnd, formerly known as trimLeft and trimRight respectively, are used to remove whitespace from the beginning or end of a string. trimStart removes whitespace from the beginning of a string, while trimEnd removes whitespace from the end. Both methods return a new string with the whitespace removed, and do not modify the original string.
Whitespace includes spaces, tabs, and newline characters. For example, if you have a string " Hello World
These methods are useful for cleaning up user input or data that may contain extraneous whitespace. They