Javascript ES11 matchAll() method

matchAll() is a new method introduced in ES11. It is used to find the matching substrings and their positions for a given string.

string.prototype.matchAll(regexp)

regexp: regular expression Returns: Array of iterators Where