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

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

@@ -36,20 +36,20 @@
<h2 id="示例">示例</h2>
<h3 id="自定义迭代器">自定义迭代器</h3>
<p>我们可以像下面这样创建自定义的迭代器:</p>
<pre class="brush: js">var myIterable = {}
<pre><code class="language-javascript">var myIterable = {}
myIterable[Symbol.iterator] = function* () {
yield 1;
yield 2;
yield 3;
};
[...myIterable] // [1, 2, 3]
</pre>
</code></pre>
<h3 id="不符合标准的迭代器">不符合标准的迭代器</h3>
<p>如果一个迭代器 <code>@@iterator</code> 没有返回一个迭代器对象,那么它就是一个不符合标准的迭代器,这样的迭代器将会在运行期抛出异常,甚至非常诡异的 Bug。</p>
<pre class="brush: js">var nonWellFormedIterable = {}
<pre><code class="language-javascript">var nonWellFormedIterable = {}
nonWellFormedIterable[Symbol.iterator] = () =&gt; 1
[...nonWellFormedIterable] // TypeError: [] is not a function
</pre>
</code></pre>
<h2 id="规范">规范</h2>
<table class="standard-table">
<tbody>