From ba91b017421b001cd226135612a7bd5dfcd88904 Mon Sep 17 00:00:00 2001 From: t7yang Date: Mon, 10 Jan 2022 08:38:06 +0800 Subject: remove inline style for zh-TW --- .../equality_comparisons_and_sameness/index.html | 242 ++++++++++----------- files/zh-tw/web/javascript/eventloop/index.html | 2 +- .../web/javascript/guide/functions/index.html | 16 +- .../javascript/guide/grammar_and_types/index.html | 4 - .../web/javascript/guide/introduction/index.html | 6 +- .../javascript/guide/numbers_and_dates/index.html | 2 +- .../reference/global_objects/math/index.html | 2 +- .../reference/operators/typeof/index.html | 12 +- 8 files changed, 141 insertions(+), 145 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 3fb16f7f38..ca2ce26b9a 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 @@ -9,7 +9,7 @@ translation_of: Web/JavaScript/Equality_comparisons_and_sameness @@ -58,74 +58,74 @@ console.log(obj === undefined); // false - 比較值 B + 比較值 B - Undefined - Null - Number - String - Boolean - Object + Undefined + Null + Number + String + Boolean + Object 比較值 A Undefined - true - true - false - false - false - false + true + true + false + false + false + false Null - true - true - false - false - false - false + true + true + false + false + false + false Number - false - false - A === B - A === ToNumber(B) - A === ToNumber(B) - A == ToPrimitive(B) + false + false + A === B + A === ToNumber(B) + A === ToNumber(B) + A == ToPrimitive(B) String - false - false - ToNumber(A) === B - A === B - ToNumber(A) === ToNumber(B) - A == ToPrimitive(B) + false + false + ToNumber(A) === B + A === B + ToNumber(A) === ToNumber(B) + A == ToPrimitive(B) Boolean - false - false - ToNumber(A) === B - ToNumber(A) === ToNumber(B) - A === B - ToNumber(A) == ToPrimitive(B) + false + false + ToNumber(A) === B + ToNumber(A) === ToNumber(B) + A === B + ToNumber(A) == ToPrimitive(B) Object - false - false - ToPrimitive(A) == B - ToPrimitive(A) == B - ToPrimitive(A) == ToNumber(B) - A === B + false + false + ToPrimitive(A) == B + ToPrimitive(A) == B + ToPrimitive(A) == ToNumber(B) + A === B @@ -192,181 +192,181 @@ function attemptMutation(v) Sameness Comparisons - x - y - == - === - Object.is + x + y + == + === + Object.is undefined undefined - true - true - true + true + true + true null null - true - true - true + true + true + true true true - true - true - true + true + true + true false false - true - true - true + true + true + true "foo" "foo" - true - true - true + true + true + true { foo: "bar" } x - true - true - true + true + true + true 0 0 - true - true - true + true + true + true +0 -0 - true - true - false + true + true + false 0 false - true - false - false + true + false + false "" false - true - false - false + true + false + false "" 0 - true - false - false + true + false + false "0" 0 - true - false - false + true + false + false "17" 17 - true - false - false + true + false + false [1,2] "1,2" - true - false - false + true + false + false new String("foo") "foo" - true - false - false + true + false + false null undefined - true - false - false + true + false + false null false - false - false - false + false + false + false undefined false - false - false - false + false + false + false { foo: "bar" } { foo: "bar" } - false - false - false + false + false + false new String("foo") new String("foo") - false - false - false + false + false + false 0 null - false - false - false + false + false + false 0 NaN - false - false - false + false + false + false "foo" NaN - false - false - false + false + false + false NaN NaN - false - false - true + false + false + true diff --git a/files/zh-tw/web/javascript/eventloop/index.html b/files/zh-tw/web/javascript/eventloop/index.html index 456fb2309d..0d579c79b0 100644 --- a/files/zh-tw/web/javascript/eventloop/index.html +++ b/files/zh-tw/web/javascript/eventloop/index.html @@ -17,7 +17,7 @@ translation_of: Web/JavaScript/EventLoop

視覺化呈現(Visual representation)

-

Stack, heap, queue

+

Stack, heap, queue

堆疊(Stack)

diff --git a/files/zh-tw/web/javascript/guide/functions/index.html b/files/zh-tw/web/javascript/guide/functions/index.html index 7360a69623..3f5d7fd370 100644 --- a/files/zh-tw/web/javascript/guide/functions/index.html +++ b/files/zh-tw/web/javascript/guide/functions/index.html @@ -21,7 +21,7 @@ translation_of: Web/JavaScript/Guide/Functions

例如,以下的程式碼定義了一個名為square的簡單函式:

-
+
function square(number) {
   return number * number;
 }
@@ -69,23 +69,23 @@ y = mycar.make;     // y 的值還是 "Honda" 

儘管上述函式定義都是用的是陳述式,函式也同樣可以由函式表達式來定義。這樣的函式可以是匿名的;它不必有名稱。例如,上面提到的函式square也可這樣來定義:

-
var square = function(number) {return number * number};
+
var square = function(number) {return number * number};
 var x = square(4) //x 的值為 16
-
必要時,函式名稱可與函式表達式同時存在,並且可以用於在函式內部代指其本身(遞迴):
+
必要時,函式名稱可與函式表達式同時存在,並且可以用於在函式內部代指其本身(遞迴):
-
 
+
 
-
var factorial = function fac(n) {return n<2 ? 1 : n*fac(n-1)};
+
var factorial = function fac(n) {return n<2 ? 1 : n*fac(n-1)};
 
 console.log(factorial(3));
 

函式表達式在將函式作為一個參數傳遞給其它函式時十分方便。下面的例子展示了一個叫map的函式如何​​被定義,而後呼叫一個匿名函式作為其第一個參數:

-
function map(f,a) {
+
function map(f,a) {
   var result = [], // Create a new Array
       i;
   for (i = 0; i != a.length; i++)
@@ -96,11 +96,11 @@ console.log(factorial(3));
 
 

下面的程式碼呼叫map函式並將一個匿名函式傳入作為第一個參數:

-
map(function(x) {return x * x * x}, [0, 1, 2, 5, 10]);
+
map(function(x) {return x * x * x}, [0, 1, 2, 5, 10]);
 // 結果會回傳 [0, 1, 8, 125, 1000]
 
-

除了上述的定義方式以外,我們也可以透過 Function constructor 來定義, 類似 eval().

+

除了上述的定義方式以外,我們也可以透過 Function constructor 來定義, 類似 eval().

呼叫函式

diff --git a/files/zh-tw/web/javascript/guide/grammar_and_types/index.html b/files/zh-tw/web/javascript/guide/grammar_and_types/index.html index 48c5d84521..04f4818cdb 100644 --- a/files/zh-tw/web/javascript/guide/grammar_and_types/index.html +++ b/files/zh-tw/web/javascript/guide/grammar_and_types/index.html @@ -273,17 +273,13 @@ MY_OBJECT.key = 'otherValue';

JavaScript 是一個動態型別的語言,這意味著你不需要在宣告變數時定義它的資料型別,程式執行時會自動轉換,你可以用下面方式宣告變數:

-
var answer = 42;
 
-

你可以指派字串在同個變數中,例如:

-
answer = "Thanks for all the fish...";
 
-

由於 Javascript 是一個動態型別的語言,因此這樣的宣告方式不會導致錯誤。

diff --git a/files/zh-tw/web/javascript/guide/introduction/index.html b/files/zh-tw/web/javascript/guide/introduction/index.html index ab855f45fc..20a7650842 100644 --- a/files/zh-tw/web/javascript/guide/introduction/index.html +++ b/files/zh-tw/web/javascript/guide/introduction/index.html @@ -29,13 +29,13 @@ translation_of: Web/JavaScript/Guide/Introduction
  • 用戶端 - JavaScript 藉由提供物件來擴增核心語言達到控制網頁瀏覽器和其文件物件模型(DOM,Document Object Model)的目的。
  • -

    舉例來說:用戶端的擴充套件允許某個應用程式將元素放置在 HTML 的表單上及對使用者的操作(例如:滑鼠點選、表單輸入、頁面導覽等)做出回應。

    +

    舉例來說:用戶端的擴充套件允許某個應用程式將元素放置在 HTML 的表單上及對使用者的操作(例如:滑鼠點選、表單輸入、頁面導覽等)做出回應。

    • 伺服器端 - JavaScript 藉由提供和伺服器上執行 JavaScript 相關的物件來擴增核心語言。
    -

    舉例來說:伺服器端的擴充套件允許某個應用程式和相關的資料庫交換訊息、對一個其他應用程式的呼叫提供連續性的資訊、在伺服器上執行檔案操作。

    +

    舉例來說:伺服器端的擴充套件允許某個應用程式和相關的資料庫交換訊息、對一個其他應用程式的呼叫提供連續性的資訊、在伺服器上執行檔案操作。

    透過 JavaScript 的 LiveConnect 功能,你可以使 Java 和 JavaScript 的程式碼彼此相連。在 JavaScript 的程式碼中,你可以實例化(instantiate)Java 的物件並存取那些物件的公有方法(public methods)及欄位(fields)。在 Java 的程式碼中,你可以存取 JavaScript 的物件、屬性(properties)及方法(methods)。

    @@ -115,7 +115,7 @@ translation_of: Web/JavaScript/Guide/Introduction   - JavaScript 的版本 + JavaScript 的版本 和 ECMAScript 版本的關係 diff --git a/files/zh-tw/web/javascript/guide/numbers_and_dates/index.html b/files/zh-tw/web/javascript/guide/numbers_and_dates/index.html index 030c75da59..d41f3f16b4 100644 --- a/files/zh-tw/web/javascript/guide/numbers_and_dates/index.html +++ b/files/zh-tw/web/javascript/guide/numbers_and_dates/index.html @@ -83,7 +83,7 @@ var notANum = Number.NaN;

    下面這張表格整理了 Number 物件的屬性

    -

    Number 的屬性

    +

    Number 的屬性

    diff --git a/files/zh-tw/web/javascript/reference/global_objects/math/index.html b/files/zh-tw/web/javascript/reference/global_objects/math/index.html index 181af7319c..1c3401c908 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/math/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/math/index.html @@ -41,7 +41,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math

    方法

    -

    注意三角函數 (sin(), cos(), tan(), asin(), acos(), atan(), atan2()) 的參數或回傳值的角度皆以弧度為單位。把角度乘上 (Math.PI / 180) 會得到弧度單位,將弧度除以該數則會轉換回一般所用的角度單位。

    +

    注意三角函數 (sin(), cos(), tan(), asin(), acos(), atan(), atan2()) 的參數或回傳值的角度皆以弧度為單位。把角度乘上 (Math.PI / 180) 會得到弧度單位,將弧度除以該數則會轉換回一般所用的角度單位。

    diff --git a/files/zh-tw/web/javascript/reference/operators/typeof/index.html b/files/zh-tw/web/javascript/reference/operators/typeof/index.html index 585d340255..92d02f05bf 100644 --- a/files/zh-tw/web/javascript/reference/operators/typeof/index.html +++ b/files/zh-tw/web/javascript/reference/operators/typeof/index.html @@ -9,9 +9,9 @@ translation_of: Web/JavaScript/Reference/Operators/typeof

    摘要

    -

    typeof 運算子會傳回一個字串值, 指出未經運算 (unevaluated) 的運算元所代表的型別。

    +

    typeof 運算子會傳回一個字串值, 指出未經運算 (unevaluated) 的運算元所代表的型別。

    -
    +
    @@ -31,13 +31,13 @@ translation_of: Web/JavaScript/Reference/Operators/typeof

    語法

    -

    typeof 之後面跟著它的唯一運算元:

    +

    typeof 之後面跟著它的唯一運算元:

    -
    typeof operand
    +
    typeof operand
    -

    參數

    +

    參數

    -
    operand 表示式代表傳入的物件或原始型別。
    +
    operand 表示式代表傳入的物件或原始型別。

    說明

    -- cgit v1.2.3-54-g00ecf
    運算子