VOOZH about

URL: https://www.geeksforgeeks.org/javascript/javascript-symbol-match-property/

⇱ JavaScript Symbol match Property - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

JavaScript Symbol match Property

Last Updated : 12 Jul, 2025

JavaScript Symbol match property is used to identify the matching of a regular expression against a string and this function is called using String match() method.

Syntax:

regexp[Symbol.match] = false;

Parameters: It does not accept any parameters. 

Return value: It will return the Boolean value for a string matching if matches found then it will return true otherwise returns false. Below examples illustrate the Symbol.match property in JavaScript.

Below examples illustrate the JavaScript Symbol match Property:

Example 1: In this example, we will check if a string starts with a particular expression defined in regexp

Output:

false
true

Example 2: In this example, we will pass a regular expression and see the type of error returned. 

Output:

Error: First argument to String.prototype.startsWith must not be a regular expression.

Supported Browsers: The browsers supported by Symbol.match property are listed below:

  • Google Chrome 51
  • Firefox 50
  • Edge 15
  • Opera
  • Apple Safari

We have a complete list of Javascript symbols' properties and methods, to check those please go through the Javascript Symbol Complete Reference article.

Comment