Without the ^ in the pattern, the output will return trueĬonsole.log(regexPattern2.test('The cat and mouse')) // Output: true For example:Ĭonsole.log(regexPattern1.test('cat and mouse')) // Output: trueĬonsole.log(regexPattern1.test('The cat and mouse')) // Output: false because the line does not start with cat
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |