Change test method from string.test(regex) to regex.test(string) (#37458)

This commit is contained in:
Chayanon Tonsai
2019-10-23 21:32:17 +07:00
committed by Tom
parent ca63f90070
commit 8b082995b5

View File

@ -14,8 +14,8 @@ The wildcard character <code>.</code> will match any one character. The wildcard
let humStr = "I'll hum a song";
let hugStr = "Bear hug";
let huRegex = /hu./;
humStr.test(huRegex); // Returns true
hugStr.test(huRegex); // Returns true
huRegex.test(humStr); // Returns true
huRegex.test(hugStr); // Returns true
```
</section>