diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/javascript/reference/global_objects/symbol/replace/index.html | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/symbol/replace/index.html')
-rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/symbol/replace/index.html | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/symbol/replace/index.html b/files/zh-cn/web/javascript/reference/global_objects/symbol/replace/index.html new file mode 100644 index 0000000000..b5a5eeb5ea --- /dev/null +++ b/files/zh-cn/web/javascript/reference/global_objects/symbol/replace/index.html @@ -0,0 +1,52 @@ +--- +title: Symbol.replace +slug: Web/JavaScript/Reference/Global_Objects/Symbol/replace +tags: + - JavaScript + - Symbol +translation_of: Web/JavaScript/Reference/Global_Objects/Symbol/replace +--- +<div>{{JSRef}}</div> + +<p><code><strong>Symbol.replace</strong></code> 这个属性指定了当一个字符串替换所匹配字符串时所调用的方法。{{jsxref("String.prototype.replace()")}} 方法会调用此方法。</p> + +<p>更多信息, 详见 {{jsxref("RegExp.@@replace", "RegExp.prototype[@@replace]()")}} 和 {{jsxref("String.prototype.replace()")}}。</p> + +<p>{{EmbedInteractiveExample("pages/js/symbol-replace.html")}}</p> + +<div>{{js_property_attributes(0,0,0)}}</div> + +<h2 id="Specifications">Specifications</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('ES2015', '#sec-symbol.replace', 'Symbol.replace')}}</td> + <td>{{Spec2('ES2015')}}</td> + <td>Initial definition.</td> + </tr> + <tr> + <td>{{SpecName('ESDraft', '#sec-symbol.replace', 'Symbol.replace')}}</td> + <td>{{Spec2('ESDraft')}}</td> + <td></td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + +<p>{{Compat("javascript.builtins.Symbol.replace")}}</p> + +<h2 id="See_also">See also</h2> + +<ul> + <li>{{jsxref("Symbol.match")}}</li> + <li>{{jsxref("Symbol.search")}}</li> + <li>{{jsxref("Symbol.split")}}</li> + <li>{{jsxref("RegExp.@@replace", "RegExp.prototype[@@replace]()")}}</li> +</ul> |