Skip to content

Commit

Permalink
Update files/en-us/web/javascript/reference/global_objects/regexp/ind…
Browse files Browse the repository at this point in the history
…ex.md
  • Loading branch information
Josh-Cena authored Sep 3, 2022
1 parent 7bee060 commit a5c53e6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Some built-in methods would treat regexes specially. They decide whether `x` is

1. `x` must be an object (not a primitive).
2. If [`x[Symbol.match]`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/match) is not `undefined`, check if it's [truthy](/en-US/docs/Glossary/Truthy).
3. Otherwise, check if `x` had been created with the `RegExp` constructor. (This step should rarely happen, since if `x` is a `RegExp` object that have not been tampered with, it should have a `Symbol.match` property.)
3. Otherwise, if `x[Symbol.match]` is `undefined`, check if `x` had been created with the `RegExp` constructor. (This step should rarely happen, since if `x` is a `RegExp` object that have not been tampered with, it should have a `Symbol.match` property.)

Note that in most cases, it would go through the `Symbol.match` check, which means:

Expand Down

0 comments on commit a5c53e6

Please sign in to comment.