diff options
Diffstat (limited to 'files/zh-tw/web/javascript/reference/global_objects/array')
6 files changed, 15 insertions, 15 deletions
diff --git a/files/zh-tw/web/javascript/reference/global_objects/array/concat/index.html b/files/zh-tw/web/javascript/reference/global_objects/array/concat/index.html index c8fc9a7aca..45730b8fad 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/array/concat/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/array/concat/index.html @@ -44,7 +44,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Array/concat <li>資料型態為字串、數值或是布林(非 {{jsxref("Global_Objects/String", "String")}}、{{jsxref("Global_Objects/Number", "Number")}} 及 {{jsxref("Global_Objects/Boolean", "Boolean")}} 物件):<code>concat</code> 複製字串及數值的值到新的陣列。</li> </ul> -<div class="note"> +<div class="notecard note"> <p><strong>備註:</strong>合併(多個)陣列/(多個)值將讓原始的陣列不會被受到影響。此外,任何對新陣列(只有在元素不是物件參考的情況下)的操作都不會影響原始的陣列,反之亦然。</p> </div> diff --git a/files/zh-tw/web/javascript/reference/global_objects/array/foreach/index.html b/files/zh-tw/web/javascript/reference/global_objects/array/foreach/index.html index df1dc91684..d1f4b27a23 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/array/foreach/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/array/foreach/index.html @@ -66,8 +66,8 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Array/forEach <p><code>forEach()</code> does not mutate the array on which it is called (although <code>callback</code>, if invoked, may do so).</p> -<div class="note"> -<p>除非是拋出異常,否則並沒有中止 <code>forEach()</code> 迴圈的辦法。如果你需要這樣做,<code>forEach()</code> 就是錯誤的用法,相反的,應該要用簡單的迴圈。如果你要測試陣列裡面的元素並回傳布林值,可以用 {{jsxref("Array.prototype.every()", "every()")}} 或 {{jsxref("Array.prototype.some()", "some()")}}。如果可以的話,新的方法 {{jsxref("Array.prototype.find()", "find()")}} 或 {{jsxref("Array.prototype.findIndex()", "findIndex()")}} 也可以用於 true 值之後提前終止。</p> +<div class="notecard note"> +<p><strong>備註:</strong>除非是拋出異常,否則並沒有中止 <code>forEach()</code> 迴圈的辦法。如果你需要這樣做,<code>forEach()</code> 就是錯誤的用法,相反的,應該要用簡單的迴圈。如果你要測試陣列裡面的元素並回傳布林值,可以用 {{jsxref("Array.prototype.every()", "every()")}} 或 {{jsxref("Array.prototype.some()", "some()")}}。如果可以的話,新的方法 {{jsxref("Array.prototype.find()", "find()")}} 或 {{jsxref("Array.prototype.findIndex()", "findIndex()")}} 也可以用於 true 值之後提前終止。</p> </div> <h2 id="範例">範例</h2> @@ -140,8 +140,8 @@ obj.sum; <p>Since the <code>thisArg</code> parameter (<code>this</code>) is provided to <code>forEach()</code>, it is passed to <code>callback</code> each time it's invoked, for use as its <code>this</code> value.</p> -<div class="note"> -<p>If passing the function argument using an <a href="/zh-TW/docs/Web/JavaScript/Reference/Functions/Arrow_functions">arrow function expression</a> the <code>thisArg</code> parameter can be omitted as arrow functions lexically bind the {{jsxref("Operators/this", "this")}} value.</p> +<div class="notecard note"> +<p><strong>Note:</strong> If passing the function argument using an <a href="/zh-TW/docs/Web/JavaScript/Reference/Functions/Arrow_functions">arrow function expression</a> the <code>thisArg</code> parameter can be omitted as arrow functions lexically bind the {{jsxref("Operators/this", "this")}} value.</p> </div> <h3 id="An_object_copy_function">An object copy function</h3> diff --git a/files/zh-tw/web/javascript/reference/global_objects/array/index.html b/files/zh-tw/web/javascript/reference/global_objects/array/index.html index f6c64c360c..112a5d1e21 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/array/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/array/index.html @@ -215,12 +215,12 @@ var myArray = myRe.exec('cdbBdbsbz'); <p>這項比對結果的屬性與元素參考如下:</p> -<table class="fullwidth-table"> +<table> <tbody> <tr> - <td class="header">屬性/元素</td> - <td class="header">說明</td> - <td class="header">範例</td> + <th>屬性/元素</th> + <th>說明</th> + <th>範例</th> </tr> <tr> <td><code>input</code></td> @@ -292,8 +292,8 @@ var myArray = myRe.exec('cdbBdbsbz'); <h2 id="Array_泛型方法"><code>Array</code> 泛型方法</h2> -<div class="warning"> -<p><strong>泛型陣列並非標準且已被棄用,將會在不久之後被去除。</strong> </p> +<div class="notecard warning"> +<p><strong>警告:</strong>泛型陣列並非標準且已被棄用,將會在不久之後被去除。</p> </div> <p>有時你想將陣列方法用於字串或其他類陣列物件(像是函數 {{jsxref("Functions/arguments", "arguments", "", 1)}})。藉此操作,你將此字串視為由字元組成的陣列(反之為將其他非陣列視為物件)。如範例,若要確認字串中的每個字元是不是字母,你可能會這樣寫:</p> diff --git a/files/zh-tw/web/javascript/reference/global_objects/array/indexof/index.html b/files/zh-tw/web/javascript/reference/global_objects/array/indexof/index.html index ff6bbdba76..960e15896d 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/array/indexof/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/array/indexof/index.html @@ -14,7 +14,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Array/indexOf <p><code><strong>indexOf()</strong></code> 方法會回傳給定元素於陣列中第一個被找到之索引,若不存在於陣列中則回傳 -1。</p> -<div class="note"> +<div class="notecard note"> <p><strong>備註:</strong>若是調用字串的方法,請參閱 {{jsxref("String.prototype.indexOf()")}}。</p> </div> diff --git a/files/zh-tw/web/javascript/reference/global_objects/array/reduce/index.html b/files/zh-tw/web/javascript/reference/global_objects/array/reduce/index.html index 1f943d8dfa..b2caccdef9 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/array/reduce/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/array/reduce/index.html @@ -58,7 +58,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Array/Reduce <p>當回呼函式第一次被呼叫時,<code>accumulator</code> 與 <code>currentValue</code> 的值可能為兩種不同的狀況:若在呼叫 <code>reduce()</code> 時有提供 <code>initialValue</code>,則 <code>accumulator</code> 將會等於 <code>initialValue</code>,且 <code>currentValue</code> 會等於陣列中的第一個元素值;若沒有提供 <code>initialValue</code>,則 <code>accumulator</code> 會等於陣列的第一個元素值,且 <code>currentValue</code> 將會等於陣列的第二個元素值。</p> -<div class="note"> +<div class="notecard note"> <p><strong>備註:</strong>假如 <code>initialValue</code> 未被提供,<code>reduce()</code> 將會跳過第一個陣列索引,從陣列索引 1 開始執行回呼函式。若有提供 <code>initialValue</code>,則會由陣列索引 0 開始執行。</p> </div> diff --git a/files/zh-tw/web/javascript/reference/global_objects/array/some/index.html b/files/zh-tw/web/javascript/reference/global_objects/array/some/index.html index 7dd0fbdf34..4f6207b9a7 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/array/some/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/array/some/index.html @@ -16,8 +16,8 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Array/some <div>{{EmbedInteractiveExample("pages/js/array-some.html")}}</div> -<div class="note"> -<p><strong>注意</strong>:如果輸入空陣列的話,這個方法會回傳 <code>false</code>。</p> +<div class="notecard note"> +<p><strong>備註:</strong>如果輸入空陣列的話,這個方法會回傳 <code>false</code>。</p> </div> |