Use Capture Groups to Search and Replace_please says different definition

Use Capture Groups to Search and Replace_please says different definition
0

#1

Tell us what’s happening:

Your code so far


let huhText = "This sandwich is good.";
let fixRegex = /good/; // Change this line
let replaceText = huhText.replace(fixRegex, "okey-dokey"); // Change this line
let result = huhText.replace(fixRegex, replaceText);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/use-capture-groups-to-search-and-replace/


#2

You are returning

This sandwich is This sandwich is okey-dokey…

You need to use capture groups like it’s using in instructions.

Look at this example and try again.

“Code Camp”.replace(/(\w+)\s(\w+)/, ‘$2 $1’);
// Returns “Camp Code”