diff --git a/curriculum/challenges/english/25-front-end-development/lecture-working-with-common-string-methods/67326c29dcd98fc5ecc49779.md b/curriculum/challenges/english/25-front-end-development/lecture-working-with-common-string-methods/67326c29dcd98fc5ecc49779.md index d4e7bd05cf3..82c13638cf0 100644 --- a/curriculum/challenges/english/25-front-end-development/lecture-working-with-common-string-methods/67326c29dcd98fc5ecc49779.md +++ b/curriculum/challenges/english/25-front-end-development/lecture-working-with-common-string-methods/67326c29dcd98fc5ecc49779.md @@ -50,35 +50,42 @@ Think about what happens when there are multiple instances of the word you are t ## --text-- -How can you replace all instances of a word in a string? +What will the following code output? + +```js +let phrase = "freeCodeCamp is awesome!"; +let updatedPhrase = phrase.replace("freecodecamp", "fCC"); + +console.log(updatedPhrase); +``` ## --answers-- -Use a `for` loop. +`"fcc is awesome!"` ### --feedback-- -Consider how regular expressions can help with multiple replacements. +Remember that the `replace()` method is case-sensitive. --- -Use `replace()` with a case-sensitive string. +`"fCC is awesome!"` ### --feedback-- -Consider how regular expressions can help with multiple replacements. +Remember that the `replace()` method is case-sensitive. --- -Use `replace()` with a global regular expression. +`"freeCodeCamp is awesome!"` --- -Use `replaceAll()` instead of `replace()`. +`undefined` ### --feedback-- -Consider how regular expressions can help with multiple replacements. +Remember that the `replace()` method is case-sensitive. ## --video-solution--