![]() |
VOOZH | about |
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:
We have a complete list of Javascript symbols' properties and methods, to check those please go through the Javascript Symbol Complete Reference article.