Build a String Formatter - Step 15

Tell us what’s happening:

output is currect but stuck with this error>You should concatenate lowercaseWord.slice(0, 5) with lowercaseWord[5].toUpperCase().

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

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

// User Editable Region

console.log(lowerCaseInput);

const lowercaseWord = "camelcase";
let camelCasedVersion = lowercaseWord.slice(0, 5) 

// User Editable Region



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

console.log(lowercaseWord.slice(0, 5)+ lowercaseWord[5].toUpperCase());

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36

Challenge Information:

Build a String Formatter - Step 15

You should concatenate in your variable not in your console.

Done thank you for your reply

What variable do you mean? A new variable or reassign the value of the variable camelCasedVersion? I tried both, but it didn’t work.

hi @graceyang668 please create your own topic to ask your questions

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.

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.