Build a String Formatter - Step 15

Tell us what’s happening:

I have tried other ways but don’t know what is wrong with my code.

Your code so far


// User Editable Region

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);

const trimmedEnd = userInput.trimEnd();
console.log("After using the trimEnd() method — trailing spaces removed:");
console.log(trimmedEnd);

const upperCaseInput = cleanedInput.toUpperCase();
console.log("Result of using the toUpperCase() method:");
console.log(upperCaseInput);

const lowerCaseInput = cleanedInput.toLowerCase();
console.log("Result of using the toLowerCase() method:");
console.log(lowerCaseInput);


//want to know what is wrong in the code below this line.
const lowercaseWord = "camelcase";
const camelCasedVersion = lowercaseWord.slice(0, 5)
console.log(lowercaseWord.slice(0,5) + lowercaseWord[5].toUpperCase())




// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.5 Safari/605.1.15

Challenge Information:

Build a String Formatter - Step 15

You need to modify this line, not the console.log() line.

Reset the step because you also removed this line

console.log("Camel cased version:");

Thanks bro, Got this.

1 Like

what is the right code now?

please create your own topic to ask your question

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge. This button only appears if you have tried to submit an answer at least three times.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.