mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-12-17 08:26:32 +08:00
语法高亮,滚动条美化,设置页面调整
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<div></div>
|
||||
<p><code><strong>forEach()</strong></code> 方法将会以插入顺序对 Map 对象中的每一个键值对执行一次参数中提供的回调函数。</p>
|
||||
<h2 id="语法">语法</h2>
|
||||
<pre class="syntaxbox"><code><em>myMap</em>.forEach(<em>callback</em>[, <em>thisArg</em>])</code></pre>
|
||||
<pre><code class="language-javascript"><code><em>myMap</em>.forEach(<em>callback</em>[, <em>thisArg</em>])</code></code></pre>
|
||||
<h3 id="参数">参数</h3>
|
||||
<dl>
|
||||
<dt><code>callback</code></dt>
|
||||
@@ -29,7 +29,7 @@
|
||||
<h2 id="示例">示例</h2>
|
||||
<h3 id="打印一个_Map_对象中的元素">打印一个 <code>Map </code>对象中的元素</h3>
|
||||
<p>下面的代码在一行中打印一个 <code>Map</code> 对象的每一个元素:</p>
|
||||
<pre class="brush:js">function logMapElements(value, key, map) {
|
||||
<pre><code class="language-js">function logMapElements(value, key, map) {
|
||||
console.log("m[" + key + "] = " + value);
|
||||
}
|
||||
Map([["foo", 3], ["bar", {}], ["baz", undefined]]).forEach(logMapElements);
|
||||
@@ -37,7 +37,7 @@ Map([["foo", 3], ["bar", {}], ["baz", undefined]]).forEach(logMapElements);
|
||||
// "m[foo] = 3"
|
||||
// "m[bar] = [object Object]"
|
||||
// "m[baz] = undefined"
|
||||
</pre>
|
||||
</code></pre>
|
||||
<h2 id="规范">规范</h2>
|
||||
<table class="standard-table">
|
||||
<tbody>
|
||||
|
||||
Reference in New Issue
Block a user