Build a String Formatter - Step 15

Tell us what’s happening:

what is the issue in my code i have tried by creating new variable
log into the console but still there is problem

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

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:");
console.log(lowerCaseInput);

const lowercaseWord = "camelcase";

// User Editable Region

const camelCasedVersion = lowercaseWord.slice(0, 5)

// User Editable Region

console.log("Camel cased version:");
console.log(camelCasedVersion);
const camelCase = lowercaseWord.slice(0, 5)+lowercaseWord[5].toUpperCase();
console.log(camelCase);

Your browser information:

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

Challenge Information:

Build a String Formatter - Step 15

You need to work on line 26 only, in the editable region. Remove the last line.

You need to use the slice method to extract an uppercase ‘c’ and concatenate the method on to the existing camelCased Variable value.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.