aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/global_objects/map/set/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/map/set/index.html')
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/map/set/index.html96
1 files changed, 0 insertions, 96 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/map/set/index.html b/files/zh-cn/web/javascript/reference/global_objects/map/set/index.html
deleted file mode 100644
index 0bdd4579ae..0000000000
--- a/files/zh-cn/web/javascript/reference/global_objects/map/set/index.html
+++ /dev/null
@@ -1,96 +0,0 @@
----
-title: Map.prototype.set()
-slug: Web/JavaScript/Reference/Global_Objects/Map/set
-tags:
- - ECMAScript6
- - JavaScript
- - Map
- - Method
- - Prototype
- - 方法
-translation_of: Web/JavaScript/Reference/Global_Objects/Map/set
----
-<p id="sect1">{{JSRef}}</p>
-
-<p><code><strong>set()</strong></code> 方法为 <code>Map</code> 对象添加或更新一个指定了键(<code>key</code>)和值(<code>value</code>)的(新)键值对。</p>
-
-<div>{{EmbedInteractiveExample("pages/js/map-prototype-set.html")}}</div>
-
-
-
-<h2 id="语法">语法</h2>
-
-<pre class="syntaxbox"><code><em>myMap</em>.set(key, value);</code></pre>
-
-<h3 id="参数">参数</h3>
-
-<dl>
- <dt>key</dt>
- <dd>要添加至相应 <code>Map</code> 对象的元素的键。</dd>
- <dt>value</dt>
- <dd>要添加至相应 <code>Map</code> 对象的元素的值。</dd>
-</dl>
-
-<h3 id="返回值">返回值</h3>
-
-<p><code>Map</code> 对象</p>
-
-<h2 id="示例">示例</h2>
-
-<h3 id="使用_set_方法">使用 <code>set</code> 方法</h3>
-
-<pre class="brush: js">var myMap = new Map();
-
-// 将一个新元素添加到 Map 对象
-myMap.set("bar", "foo");
-myMap.set(1, "foobar");
-
-// 在Map对象中更新某个元素的值
-myMap.set("bar", "baz");
-</pre>
-
-<h3 id="链式使用_set_方法">链式使用 <code>set</code> 方法</h3>
-
-<p>因为 Set() 方法返回 Map 对象本身,所以你可以像下面这样链式调用它:</p>
-
-<pre class="brush: js">// Add new elements to the map with chaining.
-myMap.set('bar', 'foo')
- .set(1, 'foobar')
- .set(2, 'baz');
-</pre>
-
-<h2 id="规范">规范</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th scope="col">规范</th>
- <th scope="col">状态</th>
- <th scope="col">备注</th>
- </tr>
- <tr>
- <td>{{SpecName('ES2015', '#sec-map.prototype.set', 'Map.prototype.set')}}</td>
- <td>{{Spec2('ES2015')}}</td>
- <td>Initial definition.</td>
- </tr>
- <tr>
- <td>{{SpecName('ESDraft', '#sec-map.prototype.set', 'Map.prototype.set')}}</td>
- <td>{{Spec2('ESDraft')}}</td>
- <td></td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="浏览器兼容性">浏览器兼容性</h2>
-
-
-
-<p>{{Compat("javascript.builtins.Map.set")}}</p>
-
-<h2 id="参见">参见</h2>
-
-<ul>
- <li>{{jsxref("Map")}}</li>
- <li>{{jsxref("Map.prototype.get()")}}</li>
- <li>{{jsxref("Map.prototype.has()")}}</li>
-</ul>