Standard built-ins
Symbol.match
Key for a custom match operation consulted by String.prototype.match; also involved in RegExp recognition.
Formal Syntax & Structure
javascript syntaxjavascript
Symbol.matchReturn Value
symbol
The predefined protocol key.
Working Example
Example Snippetjavascript
const x={[Symbol.match](s){return [s.length];}};console.log(JSON.stringify("ab".match(x)));