Build a String Formatter - Step 9

Tell us what’s happening:

The exercise in step 9 says the console.log should be below your trimmedStart() variable, yet the console.log should be below your trimmedEnd() variable. Just an observation :slight_smile:

Your code so far

const userInput = "   Hello World!   ";
console.log("Original input:");
console.log(userInput);

const cleanedInput = userInput.trim();
console.log("Result of trimming whitespace from both ends:");
console.log(cleanedInput);

const trimmedStart = userInput.trimStart();
console.log("After using the trimStart() method — leading spaces removed:");
console.log(trimmedStart);


// User Editable Region

const trimmedEnd = userInput.trimEnd();
console.log(trimmedEnd);

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36

Challenge Information:

Build a String Formatter - Step 9

https://www.freecodecamp.org/learn/full-stack-developer/workshop-string-formatter/step-9

Welcome to the forum @prlemayian

Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.

Happy coding