From a36672ec5e0f5c4434f7783c34f5782f090b9408 Mon Sep 17 00:00:00 2001 From: Osvaldo Dias dos Santos Date: Mon, 13 Mar 2023 21:00:03 +0100 Subject: [PATCH] Update "Methods of RegExp and String" article --- 9-regular-expressions/17-regexp-methods/article.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/9-regular-expressions/17-regexp-methods/article.md b/9-regular-expressions/17-regexp-methods/article.md index 0cafbbebb..897d0ffb6 100644 --- a/9-regular-expressions/17-regexp-methods/article.md +++ b/9-regular-expressions/17-regexp-methods/article.md @@ -232,10 +232,10 @@ Using a function gives us the ultimate replacement power, because it gets all th This method is essentially the same as `str.replace`, with two major differences: -1. If the first argument is a string, it replaces *all occurences* of the string, while `replace` replaces only the *first occurence*. +1. If the first argument is a string, it replaces *all occurrences* of the string, while `replace` replaces only the *first occurrence*. 2. If the first argument is a regular expression without the `g` flag, there'll be an error. With `g` flag, it works the same as `replace`. -The main use case for `replaceAll` is replacing all occurences of a string. +The main use case for `replaceAll` is replacing all occurrences of a string. Like this: