Build a String Transformer - Step 9

Tell us what’s happening:

I have the variable repeatedLove in the code along with “love”.repeat(3) assigned to the variable. I tried to log it to the console and it keeps saing you should assign “love”.repeat(3) to the repeatedLove variable, why? I have also tried const repeatedLove
repeatedLove = “love”.repeat(3)
console.log(repeatedLove)

Your code so far

const originalString = "I love cats.";
console.log("Original string:");
console.log(originalString);

const replacedString = originalString.replace("cats", "dogs");
console.log("After using the replace() method:");
console.log(replacedString);

const exampleSentence = "I love cats and cats are so much fun!";
console.log("Original sentence:");
console.log(exampleSentence);

const dogsOnlySentence = exampleSentence.replaceAll("cats", "dogs");
console.log("Replacing all occurrences of cats with dogs:");
console.log(dogsOnlySentence);

const learningSentence = "I love learning!";
console.log("Original learning sentence:");
console.log(learningSentence);


// User Editable Region

let repeatedLove = "love".repeat(3)
console.log(repeatedLove)

// 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/143.0.0.0 Safari/537.36 Edg/143.0.0.0

Challenge Information:

Build a String Transformer - Step 9

1 Like

Hi.

You have made a slight error cut and pasting the content of the variable. If you cut and paste what is in the instructions exactly you will see, and it should pass

"love ".repeat(3)

wow lol that a crazy mistake I did not catch. Thank you

1 Like