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

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

@@ -31,25 +31,25 @@
<h2 id="示例">示例</h2>
<h3 id="数组">数组</h3>
<p>默认情况下,<a href="Reference/Global_Objects/Array/concat" title="concat() 方法用于合并两个或多个数组。此方法不会更改现有数组,而是返回一个新数组。"><code>Array.prototype.concat()</code></a> 展开其元素连接到结果中:</p>
<pre class="brush: js">var alpha = ['a', 'b', 'c'],
<pre><code class="language-javascript">var alpha = ['a', 'b', 'c'],
numeric = [1, 2, 3];
var alphaNumeric = alpha.concat(numeric);
console.log(alphaNumeric); // 结果: ['a', 'b', 'c', 1, 2, 3]
</pre>
</code></pre>
<p>设置<code>Symbol.isConcatSpreadable</code><code>false</code></p>
<pre class="brush: js">var alpha = ['a', 'b', 'c'],
<pre><code class="language-javascript">var alpha = ['a', 'b', 'c'],
numeric = [1, 2, 3];
numeric[Symbol.isConcatSpreadable] = false;
var alphaNumeric = alpha.concat(numeric);
console.log(alphaNumeric); // 结果: ['a', 'b', 'c', [1, 2, 3] ]
</pre>
</code></pre>
<h3 id="Array-like_对象">Array-like 对象</h3>
<p>对于类数组 (array-like)对象,默认不展开。期望展开其元素用于连接,需要设置 <code>Symbol.isConcatSpreadable</code> 为true</p>
<pre class="brush: js">var x = [1, 2, 3];
<pre><code class="language-javascript">var x = [1, 2, 3];
var fakeArray = {
[Symbol.isConcatSpreadable]: true,
@@ -59,7 +59,7 @@ var fakeArray = {
}
x.concat(fakeArray); // [1, 2, 3, "hello", "world"]
</pre>
</code></pre>
<h2 id="技术标准">技术标准</h2>
<table class="standard-table">
<tbody>