Skip to content

misspell #3100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 9-regular-expressions/17-regexp-methods/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down