Standard built-ins
Symbol.matchAll
Key for an all-matches hook consulted by String.prototype.matchAll; ordinary RegExp input must have the global flag.
Formal Syntax & Structure
javascript syntaxjavascript
Symbol.matchAllReturn Value
symbol
The predefined protocol key.
Working Example
Example Snippetjavascript
console.log([..."a1b2".matchAll(/\d/g)].map(m=>m[0]).join(","));