Fri, 19th Feb 2021, 09:45
TIL calling RegExp.prototype.test
multiple times can return different results when the regex is a global one. 🤯
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test


RegExp.prototype.test() - JavaScript | MDN
The test() method executes a search for a match between a regular expression and a specified string. Returns true if there is a match; false otherwise.
developer.mozilla.org