VOOZH about

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

⇱ JavaScript Symbol search Property - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

JavaScript Symbol search Property

Last Updated : 12 Jul, 2025

JavaScript Symbol search property determines the method that returns the index within a string that matches the regular expression. This function is called by the String search() method.

Syntax:
[Symbol.search](string)
Parameters: It accepts single parameter "String". Return value: This returns the position of a string where it matches and if not matches it will return -1.

Below examples illustrate the Symbol search property in JavaScript:

Example 1: Output:
0
8
Example 2:
Output:
-1
-1

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

  • Google Chrome 50 and above
  • Firefox 49 and above
  • Edge 79 and above
  • Opera 37 and above
  • Apple Safari 10 and above

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

Comment