Working with String Modification Methods - How Can You Replace Parts of a String with Another?

Tell us what’s happening:

I have an issue with the response i’m getting from this: What will the following code output?

let phrase = “freeCodeCamp is awesome!”;
let updatedPhrase = phrase.replace(“freecodecamp”, “fCC”);

console.log(updatedPhrase);

“fcc is awesome!”

“fCC is awesome!”

“freeCodeCamp is awesome!”

undefined
Incorrect.

Remember that the replace() method is case-sensitive.

Well, freeCodeCamp and freecodecamp are two different phrases, therefore the correct answer should be ‘undefined’. Please clarify

Your browser information:

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

Challenge Information:

Working with String Modification Methods - How Can You Replace Parts of a String with Another?

replace does not return undefined, it returns a string, always

see the third example in the lecture for what happens if there is no matching word to replace