diff options
Diffstat (limited to 'files/zh-tw')
17 files changed, 56 insertions, 156 deletions
diff --git a/files/zh-tw/web/javascript/equality_comparisons_and_sameness/index.html b/files/zh-tw/web/javascript/equality_comparisons_and_sameness/index.html index ca2ce26b9a..1a5459883f 100644 --- a/files/zh-tw/web/javascript/equality_comparisons_and_sameness/index.html +++ b/files/zh-tw/web/javascript/equality_comparisons_and_sameness/index.html @@ -379,9 +379,6 @@ function attemptMutation(v) <dl> <dt><a href="/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#-_.28Unary_Negation.29" title="/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators"><code>- (unary negation)</code></a></dt> -</dl> - -<dl> <dd> <p>It's obvious that negating <code>0</code> produces <code>-0</code>. But the abstraction of an expression can cause <code>-0</code> to creep in when you don't realize it. For example, consider:</p> @@ -389,36 +386,27 @@ function attemptMutation(v) <p>If <code>obj.velocity</code> is <code>0</code> (or computes to <code>0</code>), a <code>-0</code> is introduced at that place and propogates out into <code>stoppingForce</code>.</p> </dd> -</dl> - -<dl> - <dt><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2"><code>Math.atan2</code></a></dt> - <dt><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil"><code>Math.ceil</code></a></dt> - <dt><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow"><code>Math.pow</code></a></dt> - <dt><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round"><code>Math.round</code></a></dt> -</dl> - -<dl> + <dt> + <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2"><code>Math.atan2</code></a>, + <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil"><code>Math.ceil</code></a>, + <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow"><code>Math.pow</code></a>, + <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round"><code>Math.round</code></a> + </dt> <dd>It's possible for a <code>-0</code> to be introduced into an expression as a return value of these methods in some cases, even when no <code>-0</code> exists as one of the parameters. E.g., using <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow"><code>Math.pow</code></a> to raise <code>-<a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity">Infinity</a></code> to the power of any negative, odd exponent evaluates to <code>-0</code>. Refer to the documentation for the individual methods.</dd> -</dl> - -<dl> - <dt><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor"><code>Math.floor</code></a></dt> - <dt><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max"><code>Math.max</code></a></dt> - <dt><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min"><code>Math.min</code></a></dt> - <dt><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sin" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sin"><code>Math.sin</code></a></dt> - <dt><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sqrt" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sqrt"><code>Math.sqrt</code></a></dt> - <dt><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tan" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tan"><code>Math.tan</code></a></dt> -</dl> - -<dl> + <dt> + <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor"><code>Math.floor</code></a>, + <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max"><code>Math.max</code></a>, + <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min"><code>Math.min</code></a>, + <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sin" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sin"><code>Math.sin</code></a>, + <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sqrt" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sqrt"><code>Math.sqrt</code></a>, + <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tan" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tan"><code>Math.tan</code></a> + </dt> <dd>It's possible to get a <code>-0</code> return value out of these methods in some cases where a <code>-0</code> exists as one of the parameters. E.g., <code>Math.min(-0, +0)</code> evalutes to <code>-0</code>. Refer to the documentation for the individual methods.</dd> -</dl> - -<dl> - <dt><code><a href="/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators" title="/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators">~</a></code></dt> - <dt><code><a href="/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators" title="/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators"><<</a></code></dt> - <dt><code><a href="/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators" title="/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators">>></a></code></dt> + <dt> + <a href="/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators" title="/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators"><code>~</code></a>, + <a href="/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators" title="/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators"><code><<</code></a>, + <a href="/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators" title="/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators"><code>>></code></a> + </dt> <dd>Each of these operators uses the ToInt32 algorithm internally. Since there is only one representation for 0 in the internal 32-bit integer type, <code>-0</code> will not survive a round trip after an inverse operation. E.g., both <code>Object.is(~~(-0), -0)</code> and <code>Object.is(-0 << 2 >> 2, -0)</code> evaluate to <code>false</code>.</dd> </dl> diff --git a/files/zh-tw/web/javascript/index.html b/files/zh-tw/web/javascript/index.html index d8b2bffb42..cc2b91de2e 100644 --- a/files/zh-tw/web/javascript/index.html +++ b/files/zh-tw/web/javascript/index.html @@ -42,27 +42,17 @@ translation_of: Web/JavaScript <h3 id="JavaScript_指南">JavaScript 指南</h3> <dl> - <dt></dt> <dt><a href="https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Guide">JavaScript 指南</a></dt> <dd>更為詳細的 JavaScript 語言指南,供過去有 JavaScript 或其他語言的程式設計經驗的人看。</dd> </dl> -<dl> -</dl> - <h3 id="中階">中階</h3> <dl> <dt><a href="/zh-TW/docs/Learn/JavaScript/Client-side_web_APIs">客戶端 web APIs</a></dt> <dd>在為網站或應用程序編寫客戶端JavaScript時,您將很快遇到應用程式介面(API)。 API是應用程式介面,用於操作運行站點的瀏覽器和操作系統的不同方面,或操縱來自其他網站或服務的資料。 在本單元中,我們將探討API是什麼,以及如何使用您在開發工作中經常遇到的一些最常見的API。 </dd> -</dl> - -<dl> <dt><a href="https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/A_re-introduction_to_JavaScript">重新介紹 JavaScript</a></dt> <dd>為了那些<em>以為</em>他們懂 JavaScript 的人寫的簡介。</dd> -</dl> - -<dl> <dt><a href="https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Data_structures">JavaScript 資料結構</a></dt> <dd>簡介在 JavaScript 可用的資料結構。</dd> <dt><a href="/zh-TW/docs/Web/JavaScript/Equality_comparisons_and_sameness">相等值比較和相等度</a></dt> diff --git a/files/zh-tw/web/javascript/reference/functions/index.html b/files/zh-tw/web/javascript/reference/functions/index.html index ce6646918f..0d64fa570a 100644 --- a/files/zh-tw/web/javascript/reference/functions/index.html +++ b/files/zh-tw/web/javascript/reference/functions/index.html @@ -74,14 +74,8 @@ function myFunc(theObject) { <dl> <dt><code>name</code></dt> <dd>The function name.</dd> -</dl> - -<dl> <dt><code>param</code></dt> <dd>The name of an argument to be passed to the function. A function can have up to 255 arguments.</dd> -</dl> - -<dl> <dt><code>statements</code></dt> <dd>The statements comprising the body of the function.</dd> </dl> @@ -98,9 +92,6 @@ function myFunc(theObject) { <dl> <dt><code>name</code></dt> <dd>The function name. Can be omitted, in which case the function becomes known as an anonymous function.</dd> -</dl> - -<dl> <dt><code>param</code></dt> <dd>The name of an argument to be passed to the function. A function can have up to 255 arguments.</dd> <dt><code>statements</code></dt> @@ -123,14 +114,8 @@ function myFunc(theObject) { <dl> <dt><code>name</code></dt> <dd>The function name.</dd> -</dl> - -<dl> <dt><code>param</code></dt> <dd>The name of an argument to be passed to the function. A function can have up to 255 arguments.</dd> -</dl> - -<dl> <dt><code>statements</code></dt> <dd>The statements comprising the body of the function.</dd> </dl> @@ -151,9 +136,7 @@ function myFunc(theObject) { <dl> <dt><code>name</code></dt> <dd>The function name. Can be omitted, in which case the function becomes known as an anonymous function.</dd> -</dl> -<dl> <dt><code>param</code></dt> <dd>The name of an argument to be passed to the function. A function can have up to 255 arguments.</dd> <dt><code>statements</code></dt> @@ -196,9 +179,6 @@ param => expression <dl> <dt><code>arg1, arg2, ... arg<em>N</em></code></dt> <dd>Zero or more names to be used by the function as formal argument names. Each must be a string that conforms to the rules for a valid JavaScript identifier or a list of such strings separated with a comma; for example "<code>x</code>", "<code>theValue</code>", or "<code>a,b</code>".</dd> -</dl> - -<dl> <dt><code>functionBody</code></dt> <dd>A string containing the JavaScript statements comprising the function definition.</dd> </dl> @@ -227,9 +207,6 @@ param => expression <dl> <dt><code>arg1, arg2, ... arg<em>N</em></code></dt> <dd>Zero or more names to be used by the function as formal argument names. Each must be a string that conforms to the rules for a valid JavaScript identifier or a list of such strings separated with a comma; for example "<code>x</code>", "<code>theValue</code>", or "<code>a,b</code>".</dd> -</dl> - -<dl> <dt><code>functionBody</code></dt> <dd>A string containing the JavaScript statements comprising the function definition.</dd> </dl> diff --git a/files/zh-tw/web/javascript/reference/global_objects/array/copywithin/index.html b/files/zh-tw/web/javascript/reference/global_objects/array/copywithin/index.html index 30520215e3..3e01759e87 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/array/copywithin/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/array/copywithin/index.html @@ -30,14 +30,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Array/copyWithin <dl> <dt><code>target</code></dt> - <dd>要複製序列(sequence)至該位置的索引(起始為 0)。若為負數,<code>target</code> 將會自陣列末項開始計算。</dd> - <dd>假如 <code>target</code> 大於等於 <code>arr.length</code>,則沒有項目會被複製。如果 <code>target</code> 的索引在 <code>start</code> 之後,則拷貝的序列將會被修剪以符合 <code>arr.length</code>。</dd> + <dd>要複製序列(sequence)至該位置的索引(起始為 0)。若為負數,<code>target</code> 將會自陣列末項開始計算。假如 <code>target</code> 大於等於 <code>arr.length</code>,則沒有項目會被複製。如果 <code>target</code> 的索引在 <code>start</code> 之後,則拷貝的序列將會被修剪以符合 <code>arr.length</code>。</dd> <dt><code>start</code> {{optional_inline}}</dt> - <dd>開始拷貝的起始元素索引(起始為 0)。若為負數,<code>start</code> 將會自陣列末項開始計算。</dd> - <dd>如果省略 <code>start</code>,<code>copyWithin</code> 將會自陣列首項開始複製(預設為 0)。</dd> + <dd>開始拷貝的起始元素索引(起始為 0)。若為負數,<code>start</code> 將會自陣列末項開始計算。如果省略 <code>start</code>,<code>copyWithin</code> 將會自陣列首項開始複製(預設為 0)。</dd> <dt><code>end</code> {{optional_inline}}</dt> - <dd>結束拷貝的結尾元素索引(起始為 0)。<code>copyWithin</code> 會拷貝至此索引,但不包含 <code>end</code>。若為負數,<code>end</code> 將會自陣列末項開始計算。</dd> - <dd>如果省略 <code>end</code>,<code>copyWithin</code> 將會一路拷貝至陣列末項(預設至 <code>arr.length</code>)。</dd> + <dd>結束拷貝的結尾元素索引(起始為 0)。<code>copyWithin</code> 會拷貝至此索引,但不包含 <code>end</code>。若為負數,<code>end</code> 將會自陣列末項開始計算。如果省略 <code>end</code>,<code>copyWithin</code> 將會一路拷貝至陣列末項(預設至 <code>arr.length</code>)。</dd> </dl> <h3 id="回傳值">回傳值</h3> diff --git a/files/zh-tw/web/javascript/reference/global_objects/array/filter/index.html b/files/zh-tw/web/javascript/reference/global_objects/array/filter/index.html index 49546e6505..ccaf9ad843 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/array/filter/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/array/filter/index.html @@ -36,16 +36,15 @@ let longWords = words.filter(word => word.length > 6); <dl> <dt><code>callback</code></dt> - <dd>此函式為一個斷言,用於測試陣列中的每個元素。回傳值為 <code>true</code> 時將當前的元素保留至新陣列中,若為 <code>false</code> 則不保留。可傳入三個參數:</dd> - <dd> - <dl> - <dt><code>element</code></dt> - <dd>原陣列目前所迭代處理中的元素。</dd> - <dt><code>index</code>{{optional_inline}}</dt> - <dd>原陣列目前所迭代處理中的元素之索引。</dd> - <dt><code>array</code>{{optional_inline}}</dt> - <dd>呼叫 <code>filter</code> 方法的陣列。</dd> - </dl> + <dd>此函式為一個斷言,用於測試陣列中的每個元素。回傳值為 <code>true</code> 時將當前的元素保留至新陣列中,若為 <code>false</code> 則不保留。可傳入三個參數: + <dl> + <dt><code>element</code></dt> + <dd>原陣列目前所迭代處理中的元素。</dd> + <dt><code>index</code>{{optional_inline}}</dt> + <dd>原陣列目前所迭代處理中的元素之索引。</dd> + <dt><code>array</code>{{optional_inline}}</dt> + <dd>呼叫 <code>filter</code> 方法的陣列。</dd> + </dl> </dd> <dt><code>thisArg</code> {{optional_inline}}</dt> <dd>可選的。執行 <code>callback</code> 回呼函式的 <code>this</code> 值。</dd> 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 8417855923..f6c64c360c 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 @@ -111,8 +111,7 @@ new Array(<var>arrayLength</var>)</pre> <dl> <dt><code>element<em>N</em></code></dt> - <dd>除了只傳遞一個參數給 <code>Array</code> 構造函數,且該參數為一個數字的情況(詳見下方的 arrayLength 參數),JavaScript 陣列會以傳入的元素進行初始化。</dd> - <dd>請注意,這種特殊情況僅適用於以 <code>Array </code>構造函數建立的 JavaScript 陣列,而不適用於以括號語法建立的陣列常值(Array Literals)。</dd> + <dd>除了只傳遞一個參數給 <code>Array</code> 構造函數,且該參數為一個數字的情況(詳見下方的 arrayLength 參數),JavaScript 陣列會以傳入的元素進行初始化。請注意,這種特殊情況僅適用於以 <code>Array </code>構造函數建立的 JavaScript 陣列,而不適用於以括號語法建立的陣列常值(Array Literals)。</dd> <dt><code>arrayLength</code></dt> <dd>如果傳遞給 <code>Array</code> 構造函數的唯一參數是 0 和 2^32 - 1(含)之間的整數,將回傳一個新的 JavaScript 陣列,其長度被設定為這個數字。如果參數是任何其他數值,將拋出 {{jsxref("RangeError")}} 異常。</dd> </dl> diff --git a/files/zh-tw/web/javascript/reference/global_objects/array/map/index.html b/files/zh-tw/web/javascript/reference/global_objects/array/map/index.html index c87fa95064..96d5a81599 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/array/map/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/array/map/index.html @@ -38,7 +38,6 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Array/map <p><code><var>callback</var></code> 函式可傳入以下三個參數:</p> <dl> - <dt></dt> <dt><code>currentValue</code></dt> <dd>原陣列目前所迭代處理中的元素。</dd> <dt><code>index</code>{{optional_inline}}</dt> diff --git a/files/zh-tw/web/javascript/reference/global_objects/array/slice/index.html b/files/zh-tw/web/javascript/reference/global_objects/array/slice/index.html index 4512eecf4e..a4daba730b 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/array/slice/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/array/slice/index.html @@ -24,15 +24,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Array/slice <dl> <dt><code>begin</code> {{optional_inline}}</dt> - <dd>自哪一個索引(起始為 0)開始提取拷貝。</dd> - <dd>可使用負數索引,表示由陣列的最末項開始提取。<code>slice(-2)</code> 代表拷貝陣列中的最後兩個元素。</dd> - <dd>假如 <code>begin</code> 為 undefined,則 <code>slice</code> 會從索引 <code>0</code> 開始提取。</dd> + <dd>自哪一個索引(起始為 0)開始提取拷貝。可使用負數索引,表示由陣列的最末項開始提取。<code>slice(-2)</code> 代表拷貝陣列中的最後兩個元素。假如 <code>begin</code> 為 undefined,則 <code>slice</code> 會從索引 <code>0</code> 開始提取。</dd> <dt><code>end</code> {{optional_inline}}</dt> - <dd>至哪一個索引(起始為 0)<em>之前</em>停止提取。<code>slice</code> 提取但不包含至索引 <code>end</code>。</dd> - <dd>舉例來說,<code>slice(1,4)</code> 提取了陣列中第二個元素至第四個元素前為止(元素索引 1、2 以及 3)來拷貝。</dd> - <dd>可使用負數索引,表示由陣列的最末項開始提取。<code>slice(2,-1)</code> 代表拷貝陣列中第三個元素至倒數第二個元素。</dd> - <dd>若省略了 <code>end</code>,則 <code>slice</code> 會提取至陣列的最後一個元素(<code>arr.length</code>)。</dd> - <dd>假如 <code>end</code> 大於陣列的長度,<code>slice</code> 會提取至陣列的最後一個元素(<code>arr.length</code>)。</dd> + <dd>至哪一個索引(起始為 0)<em>之前</em>停止提取。<code>slice</code> 提取但不包含至索引 <code>end</code>。舉例來說,<code>slice(1,4)</code> 提取了陣列中第二個元素至第四個元素前為止(元素索引 1、2 以及 3)來拷貝。可使用負數索引,表示由陣列的最末項開始提取。<code>slice(2,-1)</code> 代表拷貝陣列中第三個元素至倒數第二個元素。若省略了 <code>end</code>,則 <code>slice</code> 會提取至陣列的最後一個元素(<code>arr.length</code>)。假如 <code>end</code> 大於陣列的長度,<code>slice</code> 會提取至陣列的最後一個元素(<code>arr.length</code>)。</dd> </dl> <h3 id="回傳值">回傳值</h3> diff --git a/files/zh-tw/web/javascript/reference/global_objects/array/splice/index.html b/files/zh-tw/web/javascript/reference/global_objects/array/splice/index.html index 2cb76617b8..77215cc1e1 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/array/splice/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/array/splice/index.html @@ -26,9 +26,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Array/splice <dt><code>start</code></dt> <dd>陣列中要開始改動的元素索引(起始為 0)。若索引大於陣列長度,則實際開始的索引值會被設為陣列長度。若索引為負,則會從陣列中最後一個元素開始往前改動(起始為 -1)且若其絕對值大於陣列的長度,則會被設為 0。</dd> <dt><code>deleteCount</code> {{optional_inline}}</dt> - <dd>一個表示欲刪除的原陣列元素數量的整數。</dd> - <dd>若省略了 <code>deleteCount</code>,或假如其值大於 <code>array.length - start</code>(也就是 <code>deleteCount</code> 大於 <code>start</code> 算起的剩餘元素數量),則所有從 <code>start</code> 開始到陣列中最後一個元素都會被刪除。</dd> - <dd>若 <code>deleteCount</code> 為 0 或是負數,則不會有元素被刪除。 因此,你應該給定至少一個欲加入的新元素(見下方說明)。</dd> + <dd>一個表示欲刪除的原陣列元素數量的整數。若省略了 <code>deleteCount</code>,或假如其值大於 <code>array.length - start</code>(也就是 <code>deleteCount</code> 大於 <code>start</code> 算起的剩餘元素數量),則所有從 <code>start</code> 開始到陣列中最後一個元素都會被刪除。若 <code>deleteCount</code> 為 0 或是負數,則不會有元素被刪除。 因此,你應該給定至少一個欲加入的新元素(見下方說明)。</dd> <dt><code>item1, item2, <em>...</em></code> {{optional_inline}}</dt> <dd>從 <code>start</code> 開始,要加入到陣列的元素。 如果你沒有指定任何元素,則 <code>splice()</code> 只會依照 <code>start</code> 和 <code>deleteCount</code> 刪除陣列的元素。</dd> </dl> diff --git a/files/zh-tw/web/javascript/reference/global_objects/object/defineproperties/index.html b/files/zh-tw/web/javascript/reference/global_objects/object/defineproperties/index.html index 23eb95a642..7739ab4bdd 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/object/defineproperties/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/object/defineproperties/index.html @@ -17,34 +17,27 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/defineProperties <dt><code>obj</code></dt> <dd>The object on which to define or modify properties.</dd> <dt><code>props</code></dt> - <dd>An object whose own enumerable properties constitute descriptors for the properties to be defined or modified. Property descriptors present in objects come in two main flavors: data descriptors and accessor descriptors (see {{jsxref("Object.defineProperty()")}} for more details). Descriptors have the following keys:</dd> - <dd> - <dl> - <dt><code>configurable</code></dt> - <dd><code>true</code> if and only if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object.<br> - <strong>預設為 <code>false</code>.</strong></dd> - <dt><code>enumerable</code></dt> - <dd><code>若該屬性設為 true,則該屬性可被物件所列舉。</code><br> - <strong>預設為 <code>false</code>.</strong></dd> - </dl> - - <dl> - <dt><code>value</code></dt> - <dd>The value associated with the property. Can be any valid JavaScript value (number, object, function, etc).<br> - <strong>預設為 {{jsxref("undefined")}}.</strong></dd> - <dt><code>writable</code></dt> - <dd><code>若該屬性為 true</code>,則該屬性可透過{{jsxref("Operators/Assignment_Operators", "賦予運算子", "", 1)}}所改變<br> - <strong>預設為 <code>false</code>.</strong></dd> - </dl> - - <dl> - <dt><code>get</code></dt> - <dd>A function which serves as a getter for the property, or {{jsxref("undefined")}} if there is no getter. The function return will be used as the value of property.<br> - <strong>預設為 {{jsxref("undefined")}}.</strong></dd> - <dt><code>set</code></dt> - <dd>A function which serves as a setter for the property, or {{jsxref("undefined")}} if there is no setter. The function will receive as only argument the new value being assigned to the property.<br> - <strong>預設為 {{jsxref("undefined")}}.</strong></dd> - </dl> + <dd>An object whose own enumerable properties constitute descriptors for the properties to be defined or modified. Property descriptors present in objects come in two main flavors: data descriptors and accessor descriptors (see {{jsxref("Object.defineProperty()")}} for more details). Descriptors have the following keys: + <dl> + <dt><code>configurable</code></dt> + <dd><code>true</code> if and only if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object.<br> + <strong>預設為 <code>false</code>.</strong></dd> + <dt><code>enumerable</code></dt> + <dd><code>若該屬性設為 true,則該屬性可被物件所列舉。</code><br> + <strong>預設為 <code>false</code>.</strong></dd> + <dt><code>value</code></dt> + <dd>The value associated with the property. Can be any valid JavaScript value (number, object, function, etc).<br> + <strong>預設為 {{jsxref("undefined")}}.</strong></dd> + <dt><code>writable</code></dt> + <dd><code>若該屬性為 true</code>,則該屬性可透過{{jsxref("Operators/Assignment_Operators", "賦予運算子", "", 1)}}所改變<br> + <strong>預設為 <code>false</code>.</strong></dd> + <dt><code>get</code></dt> + <dd>A function which serves as a getter for the property, or {{jsxref("undefined")}} if there is no getter. The function return will be used as the value of property.<br> + <strong>預設為 {{jsxref("undefined")}}.</strong></dd> + <dt><code>set</code></dt> + <dd>A function which serves as a setter for the property, or {{jsxref("undefined")}} if there is no setter. The function will receive as only argument the new value being assigned to the property.<br> + <strong>預設為 {{jsxref("undefined")}}.</strong></dd> + </dl> </dd> </dl> diff --git a/files/zh-tw/web/javascript/reference/global_objects/promise/index.html b/files/zh-tw/web/javascript/reference/global_objects/promise/index.html index c14a429795..ec38359021 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/promise/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/promise/index.html @@ -66,14 +66,8 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Promise <dd>回傳一個 promise,當在引數 iterable 中所有 promises 都被實現時被實現,或在引數 iterable 中有一個 promise 被拒絕時立刻被拒絕。若回傳的 promise 被實現,它將以一個實現值的陣列被實現,其順序與 iterable 中的 promises 相同。若回傳的 promise 被拒絕,它將以失敗訊息被拒絕,此訊息來自第一個在 iterable 中被拒絕的 promise。這個方法在聚集許多 promises 的結果時很有效。</dd> <dt>{{jsxref("Promise.race", "Promise.race(iterable)")}}</dt> <dd>回傳一個被實現或拒絕的 promise,當 iterable 中有一個 promise 被實現或拒絕時。</dd> -</dl> - -<dl> <dt>{{jsxref("Promise.reject", "Promise.reject(reason)")}}</dt> <dd>回傳一個以失敗訊息拒絕的 <code>promise</code>。</dd> -</dl> - -<dl> <dt>{{jsxref("Promise.resolve", "Promise.resolve(value)")}}</dt> <dd>回傳一個以 value 實現的 <code>promise</code>。若該值為 thenable (i.e. 具有 <code>then</code> 方法),回傳的 promise 將跟隨(follow)之,採用她的最終狀態; 在其他情形回傳的 promise 將以 value 被實現。一般來說,當您不知道 value 是否為 promise,使用 {{jsxref("Promise.resolve", "Promise.resolve(value)")}},將回傳值以 promise 作處理。</dd> </dl> diff --git a/files/zh-tw/web/javascript/reference/operators/index.html b/files/zh-tw/web/javascript/reference/operators/index.html index e6efa9a181..6d27e8d2a5 100644 --- a/files/zh-tw/web/javascript/reference/operators/index.html +++ b/files/zh-tw/web/javascript/reference/operators/index.html @@ -115,9 +115,6 @@ translation_of: Web/JavaScript/Reference/Operators <dd>乘法運算子。</dd> <dt>{{jsxref("Operators/Arithmetic_Operators", "%", "#Remainder")}}</dt> <dd>餘數運算子。</dd> -</dl> - -<dl> <dt>{{jsxref("Operators/Arithmetic_Operators", "**", "#Exponentiation")}}</dt> <dd>指數運算子。</dd> </dl> diff --git a/files/zh-tw/web/javascript/reference/statements/async_function/index.html b/files/zh-tw/web/javascript/reference/statements/async_function/index.html index ced67f4a09..1111e54da6 100644 --- a/files/zh-tw/web/javascript/reference/statements/async_function/index.html +++ b/files/zh-tw/web/javascript/reference/statements/async_function/index.html @@ -29,14 +29,8 @@ translation_of: Web/JavaScript/Reference/Statements/async_function <dl> <dt><code>name</code></dt> <dd>函式名稱。</dd> -</dl> - -<dl> <dt><code>param</code></dt> <dd>傳遞至函式的參數名稱。</dd> -</dl> - -<dl> <dt><code>statements</code></dt> <dd>組成該函式主體的陳述。</dd> </dl> diff --git a/files/zh-tw/web/javascript/reference/statements/function_star_/index.html b/files/zh-tw/web/javascript/reference/statements/function_star_/index.html index 11b1013537..58180049af 100644 --- a/files/zh-tw/web/javascript/reference/statements/function_star_/index.html +++ b/files/zh-tw/web/javascript/reference/statements/function_star_/index.html @@ -31,14 +31,8 @@ translation_of: Web/JavaScript/Reference/Statements/function* <dl> <dt><code>name</code></dt> <dd>函式名稱。</dd> -</dl> - -<dl> <dt><code>param</code></dt> <dd>要被傳入函式的引數名稱,一個函式最多可以擁有 255 個引數。</dd> -</dl> - -<dl> <dt><code>statements</code></dt> <dd>statements 構成了函式內容的陳述式。</dd> </dl> diff --git a/files/zh-tw/web/javascript/reference/statements/if...else/index.html b/files/zh-tw/web/javascript/reference/statements/if...else/index.html index 8fea9e55f6..0546af300f 100644 --- a/files/zh-tw/web/javascript/reference/statements/if...else/index.html +++ b/files/zh-tw/web/javascript/reference/statements/if...else/index.html @@ -20,17 +20,10 @@ translation_of: Web/JavaScript/Reference/Statements/if...else <dl> <dt><code>條件式</code></dt> <dd>一個成立或不成立的<a href="/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#Expressions">運算式</a>。</dd> -</dl> - -<dl> <dt><code>第一個陳述式(statement1)</code></dt> <dd>如果if中的條件(conditions)為真時執行陳述式(statements)。陳述式可以為任何內容,包含巢狀式(nested)的if陳述。當要執行多行的陳述式(statements)時,使用區塊(block)將所要執行的陳述式包覆。如果不需要執行任何動作時,則不撰寫任何陳述式(empty statement)。</dd> <dt><code>第二個陳述式(statement2)</code></dt> -</dl> - -<dl> <dd>當件不成立時所執行的部份,當else被撰寫時才會被執行。可以是任何的陳述式,包含使用區塊(block)及巢狀(nested)的陳述。</dd> - <dd></dd> </dl> <h2 id="描述">描述</h2> diff --git a/files/zh-tw/web/javascript/reference/statements/index.html b/files/zh-tw/web/javascript/reference/statements/index.html index 63c3483f1b..bed5469f55 100644 --- a/files/zh-tw/web/javascript/reference/statements/index.html +++ b/files/zh-tw/web/javascript/reference/statements/index.html @@ -90,9 +90,6 @@ translation_of: Web/JavaScript/Reference/Statements <dd>Used to import functions exported from an external module, another script.</dd> <dt>{{jsxref("Statements/label", "label")}}</dt> <dd>Provides a statement with an identifier that you can refer to using a <code>break</code> or <code>continue</code> statement.</dd> -</dl> - -<dl> <dt>{{deprecated_inline}} {{jsxref("Statements/with", "with")}}</dt> <dd>Extends the scope chain for a statement.</dd> </dl> diff --git a/files/zh-tw/web/javascript/reference/statements/var/index.html b/files/zh-tw/web/javascript/reference/statements/var/index.html index 1a085c5bd9..2ef07a3afa 100644 --- a/files/zh-tw/web/javascript/reference/statements/var/index.html +++ b/files/zh-tw/web/javascript/reference/statements/var/index.html @@ -14,9 +14,6 @@ translation_of: Web/JavaScript/Reference/Statements/var <dl> <dt><code>varnameN</code></dt> <dd>變數名稱。可以是任何合法的識別字符 (identifier)。</dd> -</dl> - -<dl> <dt><code>valueN</code></dt> <dd>變數的初始值。可以是任何合法的表示式 (expression)。</dd> </dl> |