Tell us what’s happening:
Step 14 says :Change the value of the camelCasedVersion from an empty string to the result of using the slice() method on the lowercaseWord variable. Pass in the number 0 and 5 which represent the start and end indices for the slice() method.
Now you should see the word "camel" in the console.
I’ve been stuck for the past hours. Maybe i’m just overthinking or maybe I just can’t comprehend the task properly but I can’t find the right answer.
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";
const camelCasedVersion = ""
console.log("Camel cased version:");
console.log(camelCasedVersion);
// User Editable Region
const camelCasedVersion = lowercaseWord.slice(0, 5);
console.log(camelCasedVersion);
// 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/144.0.0.0 Safari/537.36 Edg/144.0.0.0
Challenge Information:
Build a String Formatter - Step 14