Symbol.replace
Symbol.replace 静态数据属性代表 众所周知的符号 Symbol.replace。String.prototype.replace() 和 String.prototype.replaceAll() 方法在其第一个参数上查找此符号,以查找替换当前对象匹配的子字符串的方法。
¥The Symbol.replace static data property represents the well-known symbol Symbol.replace. The String.prototype.replace() and String.prototype.replaceAll() methods look up this symbol on their first argument for the method that replaces substrings matched by the current object.
有关详细信息,请参阅 RegExp.prototype[Symbol.replace]()、String.prototype.replace() 和 String.prototype.replaceAll()。
¥For more information, see RegExp.prototype[Symbol.replace](), String.prototype.replace(), and String.prototype.replaceAll().
Try it
值
示例
使用 Symbol.replace
规范
| Specification | 
|---|
| ECMAScript Language Specification # sec-symbol.replace | 
浏览器兼容性
BCD tables only load in the browser