diff options
author | MDN <actions@users.noreply.github.com> | 2021-05-05 00:31:00 +0000 |
---|---|---|
committer | MDN <actions@users.noreply.github.com> | 2021-05-05 00:31:00 +0000 |
commit | 59a3c2ab5476a2ea617f780764c4b3bf3c1d3d24 (patch) | |
tree | 78e79af91257b7b63f5778438e1d03eb0c21c455 /files/zh-cn/orphaned | |
parent | 4dc84aea9c1d539c82947586ce4b74973d5cabd8 (diff) | |
download | translated-content-59a3c2ab5476a2ea617f780764c4b3bf3c1d3d24.tar.gz translated-content-59a3c2ab5476a2ea617f780764c4b3bf3c1d3d24.tar.bz2 translated-content-59a3c2ab5476a2ea617f780764c4b3bf3c1d3d24.zip |
[CRON] sync translated content
Diffstat (limited to 'files/zh-cn/orphaned')
-rw-r--r-- | files/zh-cn/orphaned/web/javascript/reference/global_objects/weakset/clear/index.html | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/files/zh-cn/orphaned/web/javascript/reference/global_objects/weakset/clear/index.html b/files/zh-cn/orphaned/web/javascript/reference/global_objects/weakset/clear/index.html new file mode 100644 index 0000000000..de4ef6da94 --- /dev/null +++ b/files/zh-cn/orphaned/web/javascript/reference/global_objects/weakset/clear/index.html @@ -0,0 +1,95 @@ +--- +title: WeakSet.prototype.clear() +slug: orphaned/Web/JavaScript/Reference/Global_Objects/WeakSet/clear +tags: + - JavaScript + - Method + - WeakSet + - 废弃 +translation_of: Web/JavaScript/Reference/Global_Objects/WeakSet/clear +original_slug: Web/JavaScript/Reference/Global_Objects/WeakSet/clear +--- +<div>{{JSRef}} {{obsolete_header}}</div> + +<p><code><strong>clear()</strong></code> 方法用于删除 <code>WeakSet</code> 对象的所有元素,但是已经不是 ECMAScript 的一部分了。</p> + +<h2 id="语法">语法</h2> + +<pre class="syntaxbox"><em>ws</em>.clear();</pre> + +<h2 id="示例">示例</h2> + +<h3 id="使用_clear方法">使用 <code>clear方法</code></h3> + +<pre class="brush: js example-bad">var ws = new WeakSet(); + +ws.add(window); +ws.has(window); // true + +ws.clear(); + +ws.has(window); // false +</pre> + +<h2 id="规范">规范</h2> + +<p>没有规范或草案。该方法原本计划包括在 ECMAScript 6,但是在草案 revision 28 (October 14, 2014) 被抛弃了。浏览器原先的实现不久后也被移除了,它从来不是标准的一分子。</p> + +<h2 id="浏览器支持">浏览器支持</h2> + +<p>{{CompatibilityTable}}</p> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>Basic support</td> + <td>36</td> + <td>{{CompatNo}} [1]</td> + <td>{{CompatNo}}</td> + <td>23</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Android</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}} [1]</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<p>[1] Added to Firefox in version 34, but removed in version 46. See {{bug(1101817)}}.</p> + +<h2 id="相关">相关</h2> + +<ul> + <li>{{jsxref("WeakSet")}}</li> + <li>{{jsxref("WeakSet.prototype.delete()")}}</li> +</ul> |