diff options
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/array')
11 files changed, 22 insertions, 29 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/array/fill/index.html b/files/zh-cn/web/javascript/reference/global_objects/array/fill/index.html index 05f19bfcb5..07c1c104b5 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/array/fill/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/array/fill/index.html @@ -42,7 +42,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Array/fill <p><code><strong>fill</strong></code> 方法故意被设计成通用方法, 该方法不要求 <code>this</code> 是数组对象。</p> -<p><code><strong style="line-height: 1.5;">fill</strong></code> 方法是个可变方法, 它会改变调用它的 <code>this</code> 对象本身, 然后返回它, 而并不是返回一个副本。</p> +<p><code><strong>fill</strong></code> 方法是个可变方法, 它会改变调用它的 <code>this</code> 对象本身, 然后返回它, 而并不是返回一个副本。</p> <p>当一个对象被传递给 <strong><code>fill</code></strong>方法的时候, 填充数组的是这个对象的引用。</p> diff --git a/files/zh-cn/web/javascript/reference/global_objects/array/findindex/index.html b/files/zh-cn/web/javascript/reference/global_objects/array/findindex/index.html index b0c8967e8e..ecde3c0f25 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/array/findindex/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/array/findindex/index.html @@ -37,7 +37,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Array/findIndex </dl> </dd> <dt><code>thisArg</code></dt> - <dd>可选。执行<code>callback</code>时作为<code style="font-size: 14px; line-height: inherit;">this</code>对象的值.</dd> + <dd>可选。执行<code>callback</code>时作为<code>this</code>对象的值.</dd> </dl> <h3 id="返回值">返回值</h3> diff --git a/files/zh-cn/web/javascript/reference/global_objects/array/map/index.html b/files/zh-cn/web/javascript/reference/global_objects/array/map/index.html index 1517622c81..15e10d0329 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/array/map/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/array/map/index.html @@ -334,7 +334,7 @@ if (!Array.prototype.map) { <p>{{Compat("javascript.builtins.Array.map")}}</p> </div> -<h2 id="See_also" name="See_also" style="margin-bottom: 20px; line-height: 30px;">相关链接</h2> +<h2 id="See_also" name="See_also">相关链接</h2> <ul> <li>{{jsxref("Array.prototype.forEach()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/array/of/index.html b/files/zh-cn/web/javascript/reference/global_objects/array/of/index.html index 25e4a88a23..9013ce9446 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/array/of/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/array/of/index.html @@ -45,7 +45,7 @@ Array(1, 2, 3); // [1, 2, 3] <h2 id="示例">示例</h2> -<pre class="brush: js" style="font-size: 14px;">Array.of(1); // [1] +<pre class="brush: js">Array.of(1); // [1] Array.of(1, 2, 3); // [1, 2, 3] Array.of(undefined); // [undefined] </pre> @@ -54,7 +54,7 @@ Array.of(undefined); // [undefined] <p>如果原生不支持的话,在其他代码之前执行以下代码会创建 <code>Array.of()</code> 。</p> -<pre class="brush: js" style="font-size: 14px;">if (!Array.of) { +<pre class="brush: js">if (!Array.of) { Array.of = function() { return Array.prototype.slice.call(arguments); }; diff --git a/files/zh-cn/web/javascript/reference/global_objects/array/pop/index.html b/files/zh-cn/web/javascript/reference/global_objects/array/pop/index.html index 51fc625019..3e6caa6795 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/array/pop/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/array/pop/index.html @@ -50,7 +50,7 @@ console.log(popped); // surgeon </pre> -<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2> +<h2 id="规范">规范</h2> <table> <tbody> diff --git a/files/zh-cn/web/javascript/reference/global_objects/array/push/index.html b/files/zh-cn/web/javascript/reference/global_objects/array/push/index.html index 3be7c12520..032e985d22 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/array/push/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/array/push/index.html @@ -32,11 +32,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Array/push <dd>被添加到数组末尾的元素。</dd> </dl> -<h3 id="返回值" style="line-height: 24px;">返回值</h3> +<h3 id="返回值">返回值</h3> <p>当调用该方法时,新的 {{jsxref("Array.length", "length")}} 属性值将被返回。</p> -<h2 id="Description" name="Description" style="margin-bottom: 20px; line-height: 30px;">描述</h2> +<h2 id="Description" name="Description">描述</h2> <p>push方法将值追加到数组中。</p> diff --git a/files/zh-cn/web/javascript/reference/global_objects/array/reduce/index.html b/files/zh-cn/web/javascript/reference/global_objects/array/reduce/index.html index c362c85c77..11e8a7ac85 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/array/reduce/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/array/reduce/index.html @@ -157,13 +157,6 @@ var maxCallback2 = ( max, cur ) => Math.max( max, cur ); </tbody> </table> -<table style="width: 100%;"> - <tbody> - <tr> - </tr> - </tbody> -</table> - <p>由<code>reduce</code>返回的值将是最后一次回调返回值(10)。</p> <p>你还可以使用{{jsxref("Functions/Arrow_functions", "箭头函数","",1)}}来代替完整的函数。 下面的代码将产生与上面的代码相同的输出:</p> diff --git a/files/zh-cn/web/javascript/reference/global_objects/array/reduceright/index.html b/files/zh-cn/web/javascript/reference/global_objects/array/reduceright/index.html index 1245486db3..793a4fd3a3 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/array/reduceright/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/array/reduceright/index.html @@ -118,7 +118,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Array/ReduceRight <p>一共会调用四次回调函数,每次调用的参数及返回值如下:</p> -<table style="width: 100%;"> +<table> <thead> <tr> <th scope="col"><code>callback</code></th> @@ -174,7 +174,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Array/ReduceRight }, 10); </pre> -<table style="width: 100%;"> +<table> <thead> <tr> <th scope="col"><code>callback</code></th> diff --git a/files/zh-cn/web/javascript/reference/global_objects/array/reverse/index.html b/files/zh-cn/web/javascript/reference/global_objects/array/reverse/index.html index a9c984245f..b408aa046f 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/array/reverse/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/array/reverse/index.html @@ -20,23 +20,23 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Array/reverse <div></div> -<h2 id="语法" style="margin-bottom: 20px; line-height: 30px;">语法</h2> +<h2 id="语法">语法</h2> <pre class="syntaxbox"><code><var> arr</var>.reverse()</code></pre> -<h3 id="返回值" style="line-height: 24px;">返回值</h3> +<h3 id="返回值">返回值</h3> <p>颠倒后的数组。</p> -<h2 id="描述" style="margin-bottom: 20px; line-height: 30px;">描述</h2> +<h2 id="描述">描述</h2> <p><code>reverse</code> 方法颠倒数组中元素的位置,改变了数组,并返回该数组的引用。</p> <p>reverse方法是特意类化的;此方法可被 <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call" title="The call() method calls a function with a given this value and arguments provided individually.">called</a> 或 <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply" title="The apply() method calls a function with a given this value, and arguments provided as an array (or an array-like object).">applied</a>于类似数组对象。对象如果不包含反映一系列连续的、基于零的数值属性中的最后一个长度的属性,则该对象可能不会以任何有意义的方式运行。</p> -<h2 id="示例" style="margin-bottom: 20px; line-height: 30px;">示例</h2> +<h2 id="示例">示例</h2> -<h3 id="颠倒数组中的元素" style="line-height: 24px;">颠倒数组中的元素</h3> +<h3 id="颠倒数组中的元素">颠倒数组中的元素</h3> <p>下例将会创建一个数组 sourceArray,其包含三个元素,然后颠倒该数组。</p> @@ -95,7 +95,7 @@ console.log(a); // {0: 3, 1: 2, 2: 1, length: 3}</code></pre> </tbody> </table> -<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2> +<h2 id="规范">规范</h2> <table class="standard-table"> <tbody> @@ -122,7 +122,7 @@ console.log(a); // {0: 3, 1: 2, 2: 1, length: 3}</code></pre> </tbody> </table> -<h2 id="浏览器兼容性" style="margin-bottom: 20px; line-height: 30px;">浏览器兼容性</h2> +<h2 id="浏览器兼容性">浏览器兼容性</h2> <div> <div> @@ -132,7 +132,7 @@ console.log(a); // {0: 3, 1: 2, 2: 1, length: 3}</code></pre> </div> </div> -<h2 id="See_also" name="See_also" style="margin-bottom: 20px; line-height: 30px;">相关链接</h2> +<h2 id="See_also" name="See_also">相关链接</h2> <ul> <li>{{jsxref("Array.prototype.join()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/array/slice/index.html b/files/zh-cn/web/javascript/reference/global_objects/array/slice/index.html index 0aa5dc1186..d62b834d40 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/array/slice/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/array/slice/index.html @@ -201,7 +201,7 @@ var list1 = list(1, 2, 3); // [1, 2, 3] }()); </pre> -<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2> +<h2 id="规范">规范</h2> <table class="standard-table"> <tbody> @@ -234,7 +234,7 @@ var list1 = list(1, 2, 3); // [1, 2, 3] </tbody> </table> -<h2 id="浏览器兼容性" style="margin-bottom: 20px; line-height: 30px;">浏览器兼容性</h2> +<h2 id="浏览器兼容性">浏览器兼容性</h2> <div> @@ -242,7 +242,7 @@ var list1 = list(1, 2, 3); // [1, 2, 3] <p>{{Compat("javascript.builtins.Array.slice")}}</p> </div> -<h2 id="See_also" name="See_also" style="margin-bottom: 20px; line-height: 30px;">相关链接</h2> +<h2 id="See_also" name="See_also">相关链接</h2> <ul> <li>{{jsxref("Array.prototype.splice()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/array/some/index.html b/files/zh-cn/web/javascript/reference/global_objects/array/some/index.html index c6e408edd2..8c5aabec0f 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/array/some/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/array/some/index.html @@ -50,7 +50,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Array/some <p><code>some()</code> 为数组中的每一个元素执行一次 <code>callback</code> 函数,直到找到一个使得 callback 返回一个“真值”(即可转换为布尔值 true 的值)。如果找到了这样一个值,<code>some()</code> 将会立即返回 <code>true</code>。否则,<code>some()</code> 返回 <code>false</code>。<code>callback</code> 只会在那些”有值“的索引上被调用,不会在那些被删除或从来未被赋值的索引上调用。</p> -<p><code style="font-style: normal; line-height: 1.5;">callback</code> 被调用时传入三个参数:元素的值,元素的索引,被遍历的数组。</p> +<p><code>callback</code> 被调用时传入三个参数:元素的值,元素的索引,被遍历的数组。</p> <p>如果一个<code>thisArg</code>参数提供给some(),它将被用作调用的 <code>callback</code>的 <code>this</code> 值。否则, 它的 <code>this</code> value将是 <code>undefined</code>。<code>this</code>的值最终通过callback来观察,根据 <a href="/en-US/docs/Web/JavaScript/Reference/Operators/this">the usual rules for determining the <code>this</code> seen by a function</a>的this判定规则来确定。</p> |