语法高亮,滚动条美化,设置页面调整

This commit is contained in:
fofolee
2019-04-19 02:41:09 +08:00
parent 1e8f76c000
commit 359d29ee0b
1590 changed files with 12328 additions and 11441 deletions

View File

@@ -2,28 +2,28 @@
<div></div>
<p><code>@@iterator</code> 属性和 <a href="Reference/Global_Objects/Array/values" title="values() 方法返回一个新的 Array Iterator 对象该对象包含数组每个索引的值"><code>Array.prototype.values()</code></a> 属性的初始值均为同一个函数对象。</p>
<h2 id="语法">语法</h2>
<pre class="brush: js"><var>arr</var>[Symbol.iterator]()</pre>
<pre><code class="language-javascript"><var>arr</var>[Symbol.iterator]()</code></pre>
<h3 id="返回值">返回值</h3>
<p>数组的 <strong>iterator </strong>方法,默认情况下与 <a href="Reference/Global_Objects/Array/values" title="values() 方法返回一个新的 Array Iterator 对象该对象包含数组每个索引的值"><code>values()</code></a> 返回值相同</p>
<h2 id="示例">示例</h2>
<h3 id="使用_for...of_循环进行迭代"><font face="Open Sans, Arial, sans-serif">使用 </font><code>for...of</code> 循环进行迭代</h3>
<pre class="brush: js">var arr = ['w', 'y', 'k', 'o', 'p'];
<pre><code class="language-javascript">var arr = ['w', 'y', 'k', 'o', 'p'];
var eArr = arr[Symbol.iterator]();
// 您的浏览器必须支持for...of循环
// 以及let —— 将变量作用域限定在 for 循环中
for (let letter of eArr) {
console.log(letter);
}
</pre>
</code></pre>
<h3 id="另一种迭代方式">另一种迭代方式</h3>
<pre class="brush: js">var arr = ['w', 'y', 'k', 'o', 'p'];
<pre><code class="language-javascript">var arr = ['w', 'y', 'k', 'o', 'p'];
var eArr = arr[Symbol.iterator]();
console.log(eArr.next().value); // w
console.log(eArr.next().value); // y
console.log(eArr.next().value); // k
console.log(eArr.next().value); // o
console.log(eArr.next().value); // p
</pre>
</code></pre>
<h2 id="规范">规范</h2>
<table class="standard-table">
<tbody>