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

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

@@ -6,14 +6,14 @@
<h3 id="返回值">返回值 </h3>
<p>从数组中删除的元素; 如果数组为空则返回<a href="Reference/Global_Objects/undefined" title="undefined是全局对象的一个属性。也就是说它是全局作用域的一个变量。undefined的最初值就是原始数据类型undefined。"><code>undefined</code></a> 。 </p>
<h2 id="语法">语法</h2>
<pre class="syntaxbox"><code><var>arr</var>.shift()</code></pre>
<pre><code class="language-javascript"><code><var>arr</var>.shift()</code></code></pre>
<h2 id="描述">描述</h2>
<p><code>shift</code> 方法移除索引为 0 的元素(即第一个元素),并返回被移除的元素,其他元素的索引值随之减 1。如果 <a href="Reference/Global_Objects/Array/length" title="length 是Array的实例属性。返回或设置一个数组中的元素个数。该值是一个无符号 32-bit 整数,并且总是大于数组最高项的下标。"><code>length</code></a> 属性的值为 0 (长度为 0),则返回 <a href="Reference/Global_Objects/undefined" title="undefined是全局对象的一个属性。也就是说它是全局作用域的一个变量。undefined的最初值就是原始数据类型undefined。"><code>undefined</code></a></p>
<p><code>shift</code> 方法并不局限于数组:这个方法能够通过 <a href="Reference/Global_Objects/Function/call" title="call() 方法调用一个函数, 其具有一个指定的this值和分别地提供的参数(参数的列表)。"><code>call</code></a><a href="Reference/Global_Objects/Function/apply" title="apply() 方法调用一个具有给定this值的函数以及作为一个数组或类似数组对象提供的参数。"><code>apply</code></a> 方法作用于类似数组的对象上。但是对于没有 length 属性从0开始的一系列连续的数字属性的最后一个的对象调用该方法可能没有任何意义。</p>
<h2 id="示例">示例</h2>
<h3 id="移除数组中的一个元素">移除数组中的一个元素</h3>
<p>以下代码显示了删除其第一个元素之前和之后的myFish数组。它还显示已删除的元素</p>
<pre class="brush: js">let myFish = ['angel', 'clown', 'mandarin', 'surgeon'];
<pre><code class="language-javascript">let myFish = ['angel', 'clown', 'mandarin', 'surgeon'];
console.log('调用 shift 之前: ' + myFish);
// "调用 shift 之前: angel,clown,mandarin,surgeon"
@@ -24,7 +24,7 @@ console.log('调用 shift 之后: ' + myFish);
// "调用 shift 之后: clown,mandarin,surgeon"
console.log('被删除的元素: ' + shifted);
// "被删除的元素: angel"</pre>
// "被删除的元素: angel"</code></pre>
<h2 id="规范">规范</h2>
<table class="standard-table">
<tbody>