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

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,8 +2,8 @@
<div></div>
<p>静态方法 <code><strong>Reflect</strong></code><strong><code>.apply()</code></strong> 通过指定的参数列表发起对目标(target)函数的调用。</p>
<h2 id="句法">句法</h2>
<pre class="syntaxbox">Reflect.apply(target, thisArgument, argumentsList)
</pre>
<pre><code class="language-javascript">Reflect.apply(target, thisArgument, argumentsList)
</code></pre>
<h3 id="参数">参数</h3>
<dl>
<dt>target</dt>
@@ -17,11 +17,11 @@
<p>如果target对象不可调用抛出<a href="Reference/Global_Objects/TypeError" title="TypeError类型错误 对象用来表示值的类型非预期类型时发生的错误。"><code>TypeError</code></a></p>
<h2 id="描述">描述</h2>
<p>该方法与ES5中<a href="Reference/Global_Objects/Function/apply" title="apply() 方法调用一个具有给定this值的函数以及作为一个数组或类似数组对象提供的参数。"><code>Function.prototype.apply()</code></a>方法类似调用一个方法并且显式地指定this变量和参数列表(arguments) ,参数列表可以是数组,或类似数组的对象。</p>
<pre class="brush: js">Function.prototype.apply.call(Math.floor, undefined, [1.75]);</pre>
<pre><code class="language-javascript">Function.prototype.apply.call(Math.floor, undefined, [1.75]);</code></pre>
<p>使用 <code>Reflect.apply</code> 方法会使代码更加简洁易懂。</p>
<h2 id="使用示例">使用示例</h2>
<h3 id="Reflect.apply()"><code>Reflect.apply()</code></h3>
<pre class="brush: js">Reflect.apply(Math.floor, undefined, [1.75]);
<pre><code class="language-javascript">Reflect.apply(Math.floor, undefined, [1.75]);
// 1;
Reflect.apply(String.fromCharCode, undefined, [104, 101, 108, 108, 111]);
@@ -32,7 +32,7 @@ Reflect.apply(RegExp.prototype.exec, /ab/, ["confabulation"]).index;
Reflect.apply("".charAt, "ponies", [3]);
// "i"
</pre>
</code></pre>
<h2 id="规范">规范</h2>
<table class="standard-table">
<tbody>