The Most Surprising Behavior of JavaScript Regular Expression You Have Ever Seen!
JavaScript regular expression objects are stateful when they have the /g or /y flag in the pattern to match.
When we create a regular expression that has the /g flag, it maintains the lastIndex property which keeps track of the index where to start ...
blog.yogeshchavan.dev3 min read