aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/global_objects/map
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/map')
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/map/@@tostringtag/index.html54
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/map/delete/index.html2
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/map/has/index.html50
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/map/index.html18
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/map/size/index.html4
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/map/values/index.html50
6 files changed, 16 insertions, 162 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/map/@@tostringtag/index.html b/files/zh-cn/web/javascript/reference/global_objects/map/@@tostringtag/index.html
index 186603b1a3..d74a6f0cdf 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/map/@@tostringtag/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/map/@@tostringtag/index.html
@@ -49,56 +49,6 @@ browser-compat: javascript.builtins.Map.@@toStringTag
</tbody>
</table>
-<h2 id="浏览器兼容">浏览器兼容</h2>
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
-<p>{{CompatibilityTable}} </p>
-
-<div>
-<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>{{ CompatChrome(44.0) }}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<div>
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Android</th>
- <th>Android Webview</th>
- <th>Firefox Mobile (Gecko)</th>
- <th>IE Mobile</th>
- <th>Opera Mobile</th>
- <th>Safari Mobile</th>
- <th>Chrome for Android</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{ CompatNo }}</td>
- <td>{{ CompatChrome(44.0) }}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatChrome(44.0)}}</td>
- </tr>
- </tbody>
-</table>
-</div>
+{{Compat}}
diff --git a/files/zh-cn/web/javascript/reference/global_objects/map/delete/index.html b/files/zh-cn/web/javascript/reference/global_objects/map/delete/index.html
index 6bbd943f7f..d2801c08d5 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/map/delete/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/map/delete/index.html
@@ -14,7 +14,7 @@ browser-compat: javascript.builtins.Map.delete
---
<div>{{JSRef}}</div>
-<p><strong> </strong><code><strong><strong>delete()</strong></strong></code><strong> </strong>方法用于移除 <code>Map</code> 对象中指定的元素。</p>
+<p><code>delete()</code> 方法用于移除 <code>Map</code> 对象中指定的元素。</p>
<div>{{EmbedInteractiveExample("pages/js/map-prototype-delete.html")}}</div>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/map/has/index.html b/files/zh-cn/web/javascript/reference/global_objects/map/has/index.html
index 461f2e5e07..0f5989851b 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/map/has/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/map/has/index.html
@@ -64,55 +64,7 @@ myMap.has("baz"); // returns false
<h2 id="浏览器兼容性">浏览器兼容性</h2>
-<p>{{CompatibilityTable}}</p>
-
-<div>
-<table class="compat-table">
- <tbody>
- <tr>
- <th>浏览器</th>
- <th>Chrome谷歌</th>
- <th>Firefox (Gecko)火狐</th>
- <th>Internet Explorer</th>
- <th>Opera</th>
- <th>Safari</th>
- </tr>
- <tr>
- <td>兼容版本</td>
- <td>38</td>
- <td>{{CompatGeckoDesktop("13.0")}}</td>
- <td>11</td>
- <td>25</td>
- <td>7.1</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<div>
-<table class="compat-table">
- <tbody>
- <tr>
- <th>浏览器</th>
- <th>Android</th>
- <th>Chrome for Android</th>
- <th>Firefox Mobile (Gecko)</th>
- <th>IE Mobile</th>
- <th>Opera Mobile</th>
- <th>Safari Mobile</th>
- </tr>
- <tr>
- <td>兼容版本</td>
- <td>{{CompatNo}}</td>
- <td>38</td>
- <td>{{CompatGeckoMobile("13.0")}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>8</td>
- </tr>
- </tbody>
-</table>
-</div>
+{{Compat}}
<h2 id="相关链接">相关链接</h2>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/map/index.html b/files/zh-cn/web/javascript/reference/global_objects/map/index.html
index 675b0f1b1b..606848aabd 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/map/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/map/index.html
@@ -52,8 +52,8 @@ browser-compat: javascript.builtins.Map
<td>
<p>一个 <code>Object</code> 有一个原型, 原型链上的键名有可能和你自己在对象上的设置的键名产生冲突。</p>
- <div class="blockIndicator note">
- <p><strong>注意:</strong> 虽然 ES5 开始可以用 <code>Object.create(null)</code> 来创建一个没有原型的对象,但是这种用法不太常见。</p>
+ <div class="note">
+ <p><strong>备注:</strong>虽然 ES5 开始可以用 <code>Object.create(null)</code> 来创建一个没有原型的对象,但是这种用法不太常见。</p>
</div>
</td>
</tr>
@@ -70,8 +70,8 @@ browser-compat: javascript.builtins.Map
<td>
<p>一个 <code>Object</code> 的键是无序的</p>
- <div class="blockIndicator note">
- <p>注意:自ECMAScript 2015规范以来,对象<em>确实</em>保留了字符串和Symbol键的创建顺序; 因此,在只有字符串键的对象上进行迭代将按插入顺序产生键。</p>
+ <div class="note">
+ <p><strong>备注:</strong>自ECMAScript 2015规范以来,对象<em>确实</em>保留了字符串和Symbol键的创建顺序; 因此,在只有字符串键的对象上进行迭代将按插入顺序产生键。</p>
</div>
</td>
</tr>
@@ -238,8 +238,8 @@ console.log(clone.get(1)); // one
console.log(original === clone); // false. 浅比较 不为同一个对象的引用
</pre>
-<div class="blockIndicator note">
-<p>重要:请记住,<em>数据本身</em>未被克隆。</p>
+<div class="note">
+ <p><strong>备注:</strong>请记住,<em>数据本身</em>未被克隆。</p>
</div>
<p>Map对象间可以进行合并,但是会保持键的唯一性。</p>
@@ -289,7 +289,7 @@ console.log(merged.get(3)); // three</pre>
<p>所以,你还是<em>可以这样做.</em>..</p>
-<pre class="syntaxbox example-bad brush js">let wrongMap = new Map()
+<pre class="brush: js example-bad">let wrongMap = new Map()
wrongMap['bla'] = 'blaa'
wrongMap['bla2'] = 'blaaa2'
@@ -298,13 +298,13 @@ console.log(wrongMap) // Map { bla: 'blaa', bla2: 'blaaa2' }
<p>...但是,这样做的话,它的行为会不符合预期:</p>
-<pre class="syntaxbox example-bad brush js">wrongMap.has('bla') // false
+<pre class="brush: js example-bad">wrongMap.has('bla') // false
wrongMap.delete('bla') // false
console.log(wrongMap) // Map { bla: 'blaa', bla2: 'blaaa2' }</pre>
<p>无论如何,和正确用法比较起来,几乎没有什么不同: </p>
-<pre class="syntaxbox brush js example-good">let myMap = new Map()
+<pre class="brush: js example-good">let myMap = new Map()
myMap.set('bla','blaa')
myMap.set('bla2','blaa2')
console.log(myMap) // Map { 'bla' =&gt; 'blaa', 'bla2' =&gt; 'blaa2' }
diff --git a/files/zh-cn/web/javascript/reference/global_objects/map/size/index.html b/files/zh-cn/web/javascript/reference/global_objects/map/size/index.html
index 97a5d475c3..f793669b7b 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/map/size/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/map/size/index.html
@@ -62,8 +62,8 @@ myMap.size // 3
<p>此页的兼容性表格请查阅:<a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> <br>
如果你想更新数据,请在GitHub上给我们发推送请求。</p>
-<div class="blockIndicator warning">
-<p><strong>异常提醒</strong></p>
+<div class="warning">
+<p><strong>警告:</strong><strong>异常提醒</strong></p>
</div>
<ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/map/values/index.html b/files/zh-cn/web/javascript/reference/global_objects/map/values/index.html
index 46e4de8672..c85c3bcc36 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/map/values/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/map/values/index.html
@@ -63,55 +63,7 @@ console.log(mapIter.next().value); // "baz"</pre>
<h2 id="浏览器兼容性">浏览器兼容性</h2>
-<p>{{CompatibilityTable}}</p>
-
-<div>
-<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>38</td>
- <td>{{ CompatGeckoDesktop("20") }}</td>
- <td>{{CompatNo}}</td>
- <td>25</td>
- <td>7.1</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<div>
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Android</th>
- <th>Chrome for 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>38</td>
- <td>{{ CompatGeckoMobile("20") }}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>8</td>
- </tr>
- </tbody>
-</table>
-</div>
+{{Compat}}
<h2 id="查看">查看</h2>