From a2617e517fe48fbd0fc283e05c82e32765a3fb12 Mon Sep 17 00:00:00 2001 From: t7yang Date: Mon, 10 Jan 2022 08:38:05 +0800 Subject: remove font tag in zh-TW --- files/zh-tw/web/javascript/data_structures/index.html | 2 +- .../web/javascript/equality_comparisons_and_sameness/index.html | 4 ++-- files/zh-tw/web/javascript/eventloop/index.html | 2 +- .../web/javascript/reference/functions/rest_parameters/index.html | 2 +- .../web/javascript/reference/global_objects/json/parse/index.html | 2 +- .../reference/global_objects/number/toexponential/index.html | 2 +- .../reference/global_objects/object/defineproperty/index.html | 2 +- .../javascript/reference/global_objects/promise/finally/index.html | 6 +++--- .../web/javascript/reference/global_objects/promise/index.html | 2 +- .../web/javascript/reference/global_objects/promise/race/index.html | 4 ++-- files/zh-tw/web/javascript/reference/operators/await/index.html | 2 +- .../javascript/reference/operators/conditional_operator/index.html | 2 +- files/zh-tw/web/javascript/reference/statements/label/index.html | 2 +- 13 files changed, 17 insertions(+), 17 deletions(-) (limited to 'files/zh-tw/web') diff --git a/files/zh-tw/web/javascript/data_structures/index.html b/files/zh-tw/web/javascript/data_structures/index.html index 29f1a048b8..f39aab97d0 100644 --- a/files/zh-tw/web/javascript/data_structures/index.html +++ b/files/zh-tw/web/javascript/data_structures/index.html @@ -250,7 +250,7 @@ Infinity

JavaScript has a standard library of built-in objects. Please have a look at the reference to find out about more objects.

-

使用 typeof 運算子來判斷型別

+

使用 typeof 運算子來判斷型別

typeof 運算子可以幫助你找到你的變數型別,請閱讀〈reference page 〉來取得更多細節及邊緣案例。

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 5821653310..3fb16f7f38 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 @@ -24,7 +24,7 @@ translation_of: Web/JavaScript/Equality_comparisons_and_sameness

要用哪個操作取決於你要哪種類型的比較。

-

簡單來說,一般相等會將型別一致化後比較;嚴格相等則不會(也就是說若型別不同,就會回傳 fasle);Object.is 會和嚴格相等做同樣的事,但會將 NaN-0 和 +0 獨立處理,因此這三個不會相等,而 Object.is(NaN, NaN) 則會回傳 true 。(用一般相等或嚴格相等比較兩個 NaN 時會回傳 false ,因為 IEEE 754 如此規範。) 切記,這三種判斷必須考慮原型,因為他們在設計上不被考慮為相等。對於任何非原型物件 x、y,即使他們有著相同結構,但如果是不同物件,比較就會是 false。

+

簡單來說,一般相等會將型別一致化後比較;嚴格相等則不會(也就是說若型別不同,就會回傳 fasle);Object.is 會和嚴格相等做同樣的事,但會將 NaN-0 和 +0 獨立處理,因此這三個不會相等,而 Object.is(NaN, NaN) 則會回傳 true 。(用一般相等或嚴格相等比較兩個 NaN 時會回傳 false ,因為 IEEE 754 如此規範。) 切記,這三種判斷必須考慮原型,因為他們在設計上不被考慮為相等。對於任何非原型物件 x、y,即使他們有著相同結構,但如果是不同物件,比較就會是 false。

嚴格相等(===

@@ -132,7 +132,7 @@ console.log(obj === undefined); // false

根據上表, ToNumber(A) 嘗試在比較前轉換成一個數字。 這等同 +A (單 + 運算子)。ToPrimitive(A) 嘗試從物件轉換成原生值,透過嘗試對 A 使用 A.toString 和 A.valueOf 方法。

-

一般來說,根據 ECMAScript 規範,所有物件應該不等於 undefined 和 null。但大多數瀏覽器允許很小部分的物件(尤其是所有頁面的 document.all 物件)在某些情況下當成 undefined。一般相等是其中一種:當 A 是個被模擬 成 undefined 的物件null == Aundefined == A 會是 true。而在其他情況下物件不會等同於 undefined 或 null。

+

一般來說,根據 ECMAScript 規範,所有物件應該不等於 undefined 和 null。但大多數瀏覽器允許很小部分的物件(尤其是所有頁面的 document.all 物件)在某些情況下當成 undefined。一般相等是其中一種:當 A 是個被模擬 成 undefined 的物件null == Aundefined == A 會是 true。而在其他情況下物件不會等同於 undefined 或 null。

var num = 0;
 var obj = new String("0");
diff --git a/files/zh-tw/web/javascript/eventloop/index.html b/files/zh-tw/web/javascript/eventloop/index.html
index 4dcfca821f..456fb2309d 100644
--- a/files/zh-tw/web/javascript/eventloop/index.html
+++ b/files/zh-tw/web/javascript/eventloop/index.html
@@ -36,7 +36,7 @@ function bar(x) {
 console.log(bar(7));
 
-

當呼叫 bar 時,會產生一個含有 bar 的參數及區域變數的 frame,而在 bar 呼叫了 foo 時,含有 foo 參數及變數的第二個 frame 就會被置於堆疊的最上面。當 foo 回傳後,最上面的 frame 會被抽離堆疊(僅留下 bar 的呼叫 frame)。然後當 bar 返回之後,堆疊就會清空。

+

當呼叫 bar 時,會產生一個含有 bar 的參數及區域變數的 frame,而在 bar 呼叫了 foo 時,含有 foo 參數及變數的第二個 frame 就會被置於堆疊的最上面。當 foo 回傳後,最上面的 frame 會被抽離堆疊(僅留下 bar 的呼叫 frame)。然後當 bar 返回之後,堆疊就會清空。

堆積(Heap)

diff --git a/files/zh-tw/web/javascript/reference/functions/rest_parameters/index.html b/files/zh-tw/web/javascript/reference/functions/rest_parameters/index.html index bed96fff03..8508f3d35c 100644 --- a/files/zh-tw/web/javascript/reference/functions/rest_parameters/index.html +++ b/files/zh-tw/web/javascript/reference/functions/rest_parameters/index.html @@ -26,7 +26,7 @@ translation_of: Web/JavaScript/Reference/Functions/rest_parameters diff --git a/files/zh-tw/web/javascript/reference/global_objects/json/parse/index.html b/files/zh-tw/web/javascript/reference/global_objects/json/parse/index.html index eb821587a5..a33e2310c3 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/json/parse/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/json/parse/index.html @@ -41,7 +41,7 @@ JSON.parse('null'); // null

使用 reviver 參數

-

如果reviver函數有被指定,字串解析後產生出來的值會在函式回傳前經過轉換。 具體來講,解析後的值或是物件屬性會一個接一個地被這個reviver函數過濾(順序是由巢狀架構中最深的到最淺的),而當一個屬性即將被過濾時,該屬性的名稱(字串形態)以及值會被當作參數傳入reviver函數。如果reviver函數回傳了 {{jsxref("undefined")}} (或是沒有回傳值, 例如:函式提早結束),則該屬性會從物件中被刪除;反之如果成功的話,該屬性的值就會被新的回傳值取代。

+

如果reviver函數有被指定,字串解析後產生出來的值會在函式回傳前經過轉換。 具體來講,解析後的值或是物件屬性會一個接一個地被這個reviver函數過濾(順序是由巢狀架構中最深的到最淺的),而當一個屬性即將被過濾時,該屬性的名稱(字串形態)以及值會被當作參數傳入reviver函數。如果reviver函數回傳了 {{jsxref("undefined")}} (或是沒有回傳值, 例如:函式提早結束),則該屬性會從物件中被刪除;反之如果成功的話,該屬性的值就會被新的回傳值取代。

如果reviver只需轉換某些特定的值,請記得將其他不須特別轉換的值以原來的值回傳,否則這些值會從回傳的結果物件中刪除。

diff --git a/files/zh-tw/web/javascript/reference/global_objects/number/toexponential/index.html b/files/zh-tw/web/javascript/reference/global_objects/number/toexponential/index.html index 622314ecfb..34ae1e4139 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/number/toexponential/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/number/toexponential/index.html @@ -30,7 +30,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Number/toExponential fractionDigits ● - 默認盡可能將數字完整顯示 + 默認盡可能將數字完整顯示 {{jsxref("Number")}}(正整數) 小數點後的位數。需為 0 至 20 之間。 diff --git a/files/zh-tw/web/javascript/reference/global_objects/object/defineproperty/index.html b/files/zh-tw/web/javascript/reference/global_objects/object/defineproperty/index.html index 292b2dbe8e..f9f6c44d39 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/object/defineproperty/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/object/defineproperty/index.html @@ -156,7 +156,7 @@ Object.defineProperty(o, 'conflict', {

如果該屬性已經存在, Object.defineProperty() 將會根據描述符內的值和物件當前的 configuration 來修改屬性。 如果舊的描述符之 configurable 的特徵為 false (屬性為 “non-configurable”), 那除了 writable 之外的特徵都將無法修改。 在這個情況,也不可能在 data 和 accessor 屬性類型中來回切換。

-

如果有一個屬性是 non-configurable, 那它的 writable 特徵只能被改變為 false.

+

如果有一個屬性是 non-configurable, 那它的 writable 特徵只能被改變為 false.

若嘗試改變 non-configurable property attributes,將會丟出一個 {{jsxref("TypeError")}},除非當前之值與新值相同。

diff --git a/files/zh-tw/web/javascript/reference/global_objects/promise/finally/index.html b/files/zh-tw/web/javascript/reference/global_objects/promise/finally/index.html index e739dcdb0f..77adc0c6fa 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/promise/finally/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/promise/finally/index.html @@ -36,11 +36,11 @@ p.finally(function() {

finally() 方法非常類似於 .then(onFinally, onFinally) 的呼叫方式,但仍有一些差異:

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 78feec28ae..60930d642f 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 @@ -94,7 +94,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Promise

建立 Promise

-

一個 Promise 物件透過 new 及其建構式建立。這個建構式接收一個叫作”執行器函式(executor function)“的引數。此函式接收兩個函式作為引數。第一個函式(resolve)在非同步作業成功完成時,以該作業之結果值被呼叫。第二個函式(reject)在作業失敗時,以失敗訊息,通常是一個 error object,被呼叫。

+

一個 Promise 物件透過 new 及其建構式建立。這個建構式接收一個叫作”執行器函式(executor function)“的引數。此函式接收兩個函式作為引數。第一個函式(resolve)在非同步作業成功完成時,以該作業之結果值被呼叫。第二個函式(reject)在作業失敗時,以失敗訊息,通常是一個 error object,被呼叫。

const myFirstPromise = new Promise((resolve, reject) => {
   // 執行一些非同步作業,最終呼叫:
diff --git a/files/zh-tw/web/javascript/reference/global_objects/promise/race/index.html b/files/zh-tw/web/javascript/reference/global_objects/promise/race/index.html
index 5022ca0ede..b116dffd61 100644
--- a/files/zh-tw/web/javascript/reference/global_objects/promise/race/index.html
+++ b/files/zh-tw/web/javascript/reference/global_objects/promise/race/index.html
@@ -28,9 +28,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Promise/race
 
 

範例

-

Promise.race 的非同步性質

+

Promise.race 的非同步性質

-

以下例子演示了 Promise.race 的非同步性質:

+

以下例子演示了 Promise.race 的非同步性質:

// we are passing as argument an array of promises that are already resolved,
 // to trigger Promise.race as soon as possible
diff --git a/files/zh-tw/web/javascript/reference/operators/await/index.html b/files/zh-tw/web/javascript/reference/operators/await/index.html
index a8bda40412..2b79ef4f9f 100644
--- a/files/zh-tw/web/javascript/reference/operators/await/index.html
+++ b/files/zh-tw/web/javascript/reference/operators/await/index.html
@@ -18,7 +18,7 @@ translation_of: Web/JavaScript/Reference/Operators/await
 
expression
等待解析的 {{jsxref("Promise")}} 物件或任何值。
-
rv = 回傳值
+
rv = 回傳值

回傳 Promise 物件的 resolved 值,或當該值不是 Promise 物件時,回傳該值本身。

diff --git a/files/zh-tw/web/javascript/reference/operators/conditional_operator/index.html b/files/zh-tw/web/javascript/reference/operators/conditional_operator/index.html index c16dc0cff1..cd0ccfa160 100644 --- a/files/zh-tw/web/javascript/reference/operators/conditional_operator/index.html +++ b/files/zh-tw/web/javascript/reference/operators/conditional_operator/index.html @@ -23,7 +23,7 @@ translation_of: Web/JavaScript/Reference/Operators/Conditional_Operator
exprIfTrue
如果 condition 的值是 truthy (等於或是可轉換為 true) , exprIfTrue  會被執行
exprIfFalse
-
如果 condition 的值是 falsy (等於或是可轉換為 false) , exprIfFalse  會被執行
+
如果 condition 的值是 falsy (等於或是可轉換為 false) , exprIfFalse  會被執行

描述

diff --git a/files/zh-tw/web/javascript/reference/statements/label/index.html b/files/zh-tw/web/javascript/reference/statements/label/index.html index fc2614ab7d..b8ba54d920 100644 --- a/files/zh-tw/web/javascript/reference/statements/label/index.html +++ b/files/zh-tw/web/javascript/reference/statements/label/index.html @@ -86,7 +86,7 @@ for (i = 0; i < items.length; i++) { itemsPassed++; }
-

for 迴圈中使用帶標記的 break 

+

for 迴圈中使用帶標記的 break

var i, j;
 
-- 
cgit v1.2.3-54-g00ecf