mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2026-02-27 09:32:01 +08:00
语法高亮,滚动条美化,设置页面调整
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
<div></div>
|
||||
<p><code><strong>add()</strong></code> 方法在 <code>WeakSet</code> 对象的最后一个元素后添加新的对象。</p>
|
||||
<h2 id="语法">语法</h2>
|
||||
<pre class="syntaxbox"><code><em>ws</em>.add(value);</code>
|
||||
</pre>
|
||||
<pre><code class="language-javascript"><code><em>ws</em>.add(value);</code>
|
||||
</code></pre>
|
||||
<h3 id="参数">参数</h3>
|
||||
<dl>
|
||||
<dt>value</dt>
|
||||
@@ -12,7 +12,7 @@
|
||||
<h3 id="返回值">返回值</h3>
|
||||
<p><code>WeakSet</code> 对象。</p>
|
||||
<h2 id="使用_add_方法">使用 <code>add</code> 方法</h2>
|
||||
<pre class="brush: js">var ws = new WeakSet();
|
||||
<pre><code class="language-javascript">var ws = new WeakSet();
|
||||
|
||||
ws.add(window); // 添加 window 对象进 WeakSet 中
|
||||
|
||||
@@ -21,7 +21,7 @@ ws.has(window); // true
|
||||
// Weakset 仅取得对象作为参数
|
||||
ws.add(1);
|
||||
// 结果为 "TypeError: Invalid value used in weak set" 在 Chrome 浏览器中
|
||||
// 并且 "TypeError: 1 is not a non-null object" 在 Firefox 浏览器中</pre>
|
||||
// 并且 "TypeError: 1 is not a non-null object" 在 Firefox 浏览器中</code></pre>
|
||||
<h2 id="规范">规范</h2>
|
||||
<table class="standard-table">
|
||||
<tbody>
|
||||
|
||||
Reference in New Issue
Block a user