aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/global_objects/map/set/index.html
diff options
context:
space:
mode:
authorMDN <actions@users.noreply.github.com>2021-07-17 00:35:32 +0000
committerMDN <actions@users.noreply.github.com>2021-07-17 00:35:32 +0000
commit7267c8c97a1e4d170a0a68e34bc0b3e029f465c7 (patch)
tree29aa504788a86f837520d06e7e5cfab33aeacf3d /files/zh-cn/web/javascript/reference/global_objects/map/set/index.html
parenta53bff5bca8db992fdf2ac0c68a82e7a1a53ab7e (diff)
downloadtranslated-content-7267c8c97a1e4d170a0a68e34bc0b3e029f465c7.tar.gz
translated-content-7267c8c97a1e4d170a0a68e34bc0b3e029f465c7.tar.bz2
translated-content-7267c8c97a1e4d170a0a68e34bc0b3e029f465c7.zip
[CRON] sync translated content
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.html97
1 files changed, 0 insertions, 97 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 ae2ff00036..0000000000
--- a/files/zh-cn/web/javascript/reference/global_objects/map/set/index.html
+++ /dev/null
@@ -1,97 +0,0 @@
----
-title: Map.prototype.set()
-slug: Web/JavaScript/Reference/Global_Objects/Map/set
-translation_of: Web/JavaScript/Reference/Global_Objects/Map/set
-tags:
- - ECMAScript 2015
- - JavaScript
- - Map
- - Method
- - Prototype
- - Reference
-browser-compat: javascript.builtins.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>