Symbol.replace

Symbol.replace 这个属性指定了当一个字符串替换所匹配字符串时所调用的方法。String.prototype.replace() 方法会调用此方法。

更多信息, 详见 RegExp.prototype[@@replace]() 和 String.prototype.replace()

Symbol.replace 属性的属性特性:
writable false
enumerable false
configurable false

Specifications

Specification Status Comment
ECMAScript 2015 (6th Edition, ECMA-262)
Symbol.replace
Standard Initial definition.
ECMAScript (ECMA-262)
Symbol.replace
Living Standard

Browser compatibility

Update compatibility data on GitHub
DesktopMobileServer
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
replaceChrome Full support 50Edge Full support 79Firefox Full support 49IE No support NoOpera Full support 37Safari Full support 10WebView Android Full support 50Chrome Android Full support 50Firefox Android Full support 49Opera Android Full support 37Safari iOS Full support 10Samsung Internet Android Full support 5.0nodejs Full support 6.0.0

Legend

Full support  
Full support
No support  
No support

See also