From 0029c51a9a19fe8e802440cb908fab9ee937888a Mon Sep 17 00:00:00 2001 From: Diem-Trang Pham <6422507+pdtrang@users.noreply.github.com> Date: Mon, 17 Nov 2025 03:51:48 -0600 Subject: [PATCH] fix(curriculum): add missing content replaceAll() in JS strings review (#63895) --- .../review-javascript-strings/6723c1946e4cd7909a836bb4.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/curriculum/challenges/english/blocks/review-javascript-strings/6723c1946e4cd7909a836bb4.md b/curriculum/challenges/english/blocks/review-javascript-strings/6723c1946e4cd7909a836bb4.md index bbb9383af27..5fe19d511e8 100644 --- a/curriculum/challenges/english/blocks/review-javascript-strings/6723c1946e4cd7909a836bb4.md +++ b/curriculum/challenges/english/blocks/review-javascript-strings/6723c1946e4cd7909a836bb4.md @@ -104,6 +104,13 @@ console.log(text.toLowerCase()); // "hello, world!" const text = "I like cats"; console.log(text.replace("cats", "dogs")); // "I like dogs" ``` + +- **The `replaceAll()` Method**: This method allows you to find all occurrences of a specified value (a word, character, or pattern) in a string and replace them with another value. It works like replace(), but instead of stopping after the first match, it updates every match found in the string. + +```js +const text = "I love cats and cats are so much fun!"; +console.log(text.replaceAll("cats", "dogs")); // "I love dogs and dogs are so much fun!" +``` - **The `repeat()` Method**: This method is used to repeat a string a specified number of times.