VOOZH about

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

⇱ JavaScript Symbol replace Property - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

JavaScript Symbol replace Property

Last Updated : 12 Jul, 2025

JavaScript Symbol replace the property is used to determine the method that replaces the matched substring of a string. This function is called by the String replace() method.

Syntax:

[Symbol.replace](string)

Parameters: It accepts single parameter "String".

Return value: It will return a new string. The below examples illustrate the Symbol.replace the property in JavaScript: 

Below examples illustrate the JavaScript Symbol replace Property

Example 1: In this example, we will 

Output:

"geeksforgeeks --> GEEKSFORGEEKS"
"Article written by --> Shubham Singh"

Example 2: 

Output:

"Before: geeksforgeeks"
"After: GEEKSFORGEEKS"
"Before: Few Users"
"After: Millions of Users"

Supported Browsers: The browsers supported by Symbol replace 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