Courses / JavaScript
29. String.prototype.trimStart()
Removes whitespace from the beginning of a string.
1 min read Chapter 29 of 99
JavaScript
String.prototype.trimStart()
trimStart() removes whitespace from the beginning of a string.
"I often end up with extra spaces in my input fields that I need to clean up."
The `trimStart()` method creates a new string by removing whitespace from the start of the original string. It's useful for cleaning up user input or formatting strings.
"I often end up with extra spaces in my input fields that I need to clean up."
The `trimStart()` method creates a new string by removing whitespace from the start of the original string. It's useful for cleaning up user input or formatting strings.