Standard built-ins

Symbol.matchAll

Try the free JavaScript compiler

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.matchAll

Return Value

symbol

The predefined protocol key.

Working Example

Example Snippetjavascript
console.log([..."a1b2".matchAll(/\d/g)].map(m=>m[0]).join(","));
JavaScript Reference