trimStart < String < JavaScript
The trimStart() of a String removes whitespace from the beginning of the string and returns a new string without modifying the original string.
const greeting = ' Hello world! ';
const greetingTrimStart = greeting.trimStart();
console.log(greetingTrimStart);
// "Hello world! ";
console.log(greeting);
// " Hello world! ";