Grammar Checker - Task 9

At the moment the task asks to replace one badword which is at index 78 with a good word which is quite simple to do as the whole text only has one bad word (from freaking to really).

storyWords[78] = 'really'

What if there is more than one of the same bad word i want to replace. Say i have 5 freaking word. Is there way of either using map or a for loop to loop around find all the ‘freaking’ word and replace it with ‘really’?


Yes. You can return a map where every time a word is equal to the “bad” word, you replace it with a “good” word.