From 7a9db40025c2f387b4b75b4bd0d32a18a63c0d87 Mon Sep 17 00:00:00 2001 From: t7yang Date: Mon, 10 Jan 2022 08:38:07 +0800 Subject: remove sup tag for zh-TW --- files/zh-tw/web/javascript/about_javascript/index.html | 2 +- files/zh-tw/web/javascript/data_structures/index.html | 2 +- .../web/javascript/guide/expressions_and_operators/index.html | 2 +- files/zh-tw/web/javascript/guide/numbers_and_dates/index.html | 2 +- files/zh-tw/web/javascript/language_resources/index.html | 2 +- files/zh-tw/web/javascript/reference/classes/index.html | 4 ++-- .../javascript/reference/errors/invalid_array_length/index.html | 6 +++--- .../web/javascript/reference/global_objects/array/index.html | 2 +- .../javascript/reference/global_objects/array/length/index.html | 6 +++--- .../web/javascript/reference/global_objects/bigint/index.html | 8 ++++---- .../zh-tw/web/javascript/reference/global_objects/math/index.html | 4 ++-- .../web/javascript/reference/global_objects/math/pow/index.html | 4 ++-- .../javascript/reference/global_objects/math/random/index.html | 2 +- .../web/javascript/reference/global_objects/number/index.html | 6 +++--- .../web/javascript/reference/global_objects/typedarray/index.html | 4 ++-- 15 files changed, 28 insertions(+), 28 deletions(-) diff --git a/files/zh-tw/web/javascript/about_javascript/index.html b/files/zh-tw/web/javascript/about_javascript/index.html index bd1d7f54f5..725abd3c2e 100644 --- a/files/zh-tw/web/javascript/about_javascript/index.html +++ b/files/zh-tw/web/javascript/about_javascript/index.html @@ -7,7 +7,7 @@ translation_of: Web/JavaScript/About_JavaScript

什麼是 JavaScript?

-

JavaScript® 是被用在上百萬的網頁和伺服器應用程式的一種網景開發物件腳本語言。Netscape's JavaScript 是 ECMA-262 Edition 3 (ECMAScript)的基礎標準腳本語言,兩者之間從公佈的標準只有輕微的差異。

+

JavaScript® 是被用在上百萬的網頁和伺服器應用程式的一種網景開發物件腳本語言。Netscape's JavaScript 是 ECMA-262 Edition 3 (ECMAScript)的基礎標準腳本語言,兩者之間從公佈的標準只有輕微的差異。

相對於常見的誤解,JavaScript 不是「解釋型的 Java」。簡言之,JavaScript 是一種動態的腳本語言,支持基於原型的物件結構。基本語法是故意類似 Java 和 C + + 來減少需要學習語言的新概念。語言結構,如 if 語句,for 和 while 迴圈,和switch,並try ... catch塊的功能在這些語言中的相同(或接近)。

diff --git a/files/zh-tw/web/javascript/data_structures/index.html b/files/zh-tw/web/javascript/data_structures/index.html index a8462f6e55..83b215697f 100644 --- a/files/zh-tw/web/javascript/data_structures/index.html +++ b/files/zh-tw/web/javascript/data_structures/index.html @@ -53,7 +53,7 @@ var foo = true; // foo 目前是布林值

數字型別

-

根據 ECMAScript 標準,數字型別只有一種:雙精度 64 位元二進制格式 IEEE 754 值(在 -(253 -1) and 253 -1 之間的數字)。而整數並沒有指定的型別。數字除了能代表浮點數以外,還有三個符號值:+Infinity-InfinityNaN(not-a-number,非數字)。

+

根據 ECMAScript 標準,數字型別只有一種:雙精度 64 位元二進制格式 IEEE 754 值(在 -(2^53 -1) and 2^53 -1 之間的數字)。而整數並沒有指定的型別。數字除了能代表浮點數以外,還有三個符號值:+Infinity-InfinityNaN(not-a-number,非數字)。

要檢查在 +/-Infinity 內可用的最大值或最小值,可以用 {{jsxref("Number.MAX_VALUE")}} 或 {{jsxref("Number.MIN_VALUE")}} 常數。從 ECMAScript 6 開始,也可以透過 {{jsxref("Number.isSafeInteger()")}}、{{jsxref("Number.MAX_SAFE_INTEGER")}}、{{jsxref("Number.MIN_SAFE_INTEGER")}} 檢查某數字是否為雙精度浮點值之間。Beyond this range, integers in JavaScript are not safe anymore and will be a double-precision floating point approximation of the value.

diff --git a/files/zh-tw/web/javascript/guide/expressions_and_operators/index.html b/files/zh-tw/web/javascript/guide/expressions_and_operators/index.html index df48ec6e8f..4e0c8655bc 100644 --- a/files/zh-tw/web/javascript/guide/expressions_and_operators/index.html +++ b/files/zh-tw/web/javascript/guide/expressions_and_operators/index.html @@ -264,7 +264,7 @@ var var2 = 4; 指數運算子 (**) {{experimental_inline}} - 計算以 a 為底的 b 次方, 也就是, ab + 計算以 a 為底的 b 次方, 也就是, a^b 2 ** 3 回傳 8.
10 ** -1 回傳 0.1. 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 d41f3f16b4..890f62f231 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 @@ -9,7 +9,7 @@ translation_of: Web/JavaScript/Guide/Numbers_and_dates

數字(Numbers)

-

在 JavaScript 中, Number所使用的標準依照 double-precision 64-bit binary format IEEE 754 (i.e. number的區間是 -(253 -1) 到 253 -1)。整數是沒有特定的類型

+

在 JavaScript 中, Number所使用的標準依照 double-precision 64-bit binary format IEEE 754 (i.e. number的區間是 -(2^53 -1) 到 2^53 -1)。整數是沒有特定的類型

此外還可以顯示浮點數,三種符號數值: +{{jsxref("Infinity")}}, -{{jsxref("Infinity")}}, and {{jsxref("NaN")}} (not-a-number)。

diff --git a/files/zh-tw/web/javascript/language_resources/index.html b/files/zh-tw/web/javascript/language_resources/index.html index 975722d97a..5267273e5c 100644 --- a/files/zh-tw/web/javascript/language_resources/index.html +++ b/files/zh-tw/web/javascript/language_resources/index.html @@ -44,7 +44,7 @@ translation_of: Web/JavaScript/Language_Resources ECMA-262 Edition 5.1 PDF June 2011 - ECMAScript 5.1。這是目前最新的版本。這個版本同時對上了 3rd edition of the international standard ISO/IEC 16262:2011。他只多了 ES5 額外的修正,並沒增加新的 features。 + ECMAScript 5.1。這是目前最新的版本。這個版本同時對上了 3 edition of the international standard ISO/IEC 16262:2011。他只多了 ES5 額外的修正,並沒增加新的 features。 ECMA-357 diff --git a/files/zh-tw/web/javascript/reference/classes/index.html b/files/zh-tw/web/javascript/reference/classes/index.html index d81add9317..06ea8d5719 100644 --- a/files/zh-tw/web/javascript/reference/classes/index.html +++ b/files/zh-tw/web/javascript/reference/classes/index.html @@ -312,7 +312,7 @@ l.speak(); Basic support - {{CompatChrome(42.0)}}[1]
+ {{CompatChrome(42.0)}}[1]
{{CompatChrome(49.0)}} {{CompatGeckoDesktop(45)}} 13 @@ -343,7 +343,7 @@ l.speak(); {{CompatUnknown}} {{CompatUnknown}} 9 - {{CompatChrome(42.0)}}[1]
+ {{CompatChrome(42.0)}}[1]
{{CompatChrome(49.0)}} diff --git a/files/zh-tw/web/javascript/reference/errors/invalid_array_length/index.html b/files/zh-tw/web/javascript/reference/errors/invalid_array_length/index.html index ee2c5f08e4..89f7a02df6 100644 --- a/files/zh-tw/web/javascript/reference/errors/invalid_array_length/index.html +++ b/files/zh-tw/web/javascript/reference/errors/invalid_array_length/index.html @@ -22,11 +22,11 @@ RangeError: Invalid array buffer length (Chrome)

一個無效的陣列長度可能發生於以下幾種情形:

-

為什麼 Array  和 ArrayBuffer 的長度有限?   Array 和 ArrayBuffer 的屬性以一個32位元的非負整數表使,因此僅能儲存 0 到 232-1 的數值。

+

為什麼 Array  和 ArrayBuffer 的長度有限?   Array 和 ArrayBuffer 的屬性以一個32位元的非負整數表使,因此僅能儲存 0 到 2^32 - 1 的數值。

If you are creating an Array, using the constructor, you probably want to use the literal notation instead, as the first argument is interpreted as the length of the Array.

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 ee63054506..8417855923 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 @@ -114,7 +114,7 @@ new Array(arrayLength)
除了只傳遞一個參數給 Array 構造函數,且該參數為一個數字的情況(詳見下方的 arrayLength 參數),JavaScript 陣列會以傳入的元素進行初始化。
請注意,這種特殊情況僅適用於以 Array 構造函數建立的 JavaScript 陣列,而不適用於以括號語法建立的陣列常值(Array Literals)。
arrayLength
-
如果傳遞給 Array 構造函數的唯一參數是 0 和 232-1(含)之間的整數,將回傳一個新的 JavaScript 陣列,其長度被設定為這個數字。如果參數是任何其他數值,將拋出 {{jsxref("RangeError")}} 異常。
+
如果傳遞給 Array 構造函數的唯一參數是 0 和 2^32 - 1(含)之間的整數,將回傳一個新的 JavaScript 陣列,其長度被設定為這個數字。如果參數是任何其他數值,將拋出 {{jsxref("RangeError")}} 異常。

說明

diff --git a/files/zh-tw/web/javascript/reference/global_objects/array/length/index.html b/files/zh-tw/web/javascript/reference/global_objects/array/length/index.html index 1b6497b07a..6f13a69ecd 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/array/length/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/array/length/index.html @@ -14,9 +14,9 @@ items.length;

描述

-

length 屬性的值必為一正整數,其值必介於 0 ~ 232 (不包含)之間.

+

length 屬性的值必為一正整數,其值必介於 0 ~ 2^32 (不包含)之間.

-
var namelistA = new Array(4294967296); //232 = 4294967296
+
var namelistA = new Array(4294967296); //2^32 = 4294967296
 var namelistC = new Array(-100) //負數
 
 console.log(namelistA.length); //RangeError: Invalid array length
@@ -25,7 +25,7 @@ console.log(namelistC.length); //RangeError: Invalid array length
 
 
 var namelistB = [];
-namelistB.length = Math.pow(2,32)-1; //將長度設定介於 0 ~ 232 -1
+namelistB.length = Math.pow(2,32)-1; //將長度設定介於 0 ~ 2^32 -1
 console.log(namelistB.length);
 
 //4294967295
diff --git a/files/zh-tw/web/javascript/reference/global_objects/bigint/index.html b/files/zh-tw/web/javascript/reference/global_objects/bigint/index.html index 705a85e255..35ccd60a0b 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/bigint/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/bigint/index.html @@ -5,7 +5,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/BigInt ---

{{JSRef}}{{SeeCompatTable}}

-

BigInt 是一個內建的物件,提供了表示大於253的整數的功能 (253是JavaScript原生的{{JSxRef("Number")}}能夠表示的最大值)

+

BigInt 是一個內建的物件,提供了表示大於2^53的整數的功能 (2^53是JavaScript原生的{{JSxRef("Number")}}能夠表示的最大值)

語法

@@ -189,9 +189,9 @@ Boolean(12n)
{{JSxRef("BigInt.asIntN()")}}
-
Wraps a BigInt between -2width-1 and 2width-1-1
+
Clamps a BigInt value to a signed integer value, and returns that value.
{{JSxRef("BigInt.asUintN()")}}
-
Wraps a BigInt between 0 and 2width-1
+
Clamps a BigInt value to an unsigned integer value, and returns that value.

屬性

@@ -213,7 +213,7 @@ Boolean(12n)

轉型

-

因為在 {{JSxRef("Global_Objects/Number", "Number")}} 和 BigInt 之間轉換可能造成精度遺失,建議當數值會超過253時只使用 BigInt ,而不要在兩者之間進行轉換。

+

因為在 {{JSxRef("Global_Objects/Number", "Number")}} 和 BigInt 之間轉換可能造成精度遺失,建議當數值會超過2^53時只使用 BigInt ,而不要在兩者之間進行轉換。

加密

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 1c3401c908..2b09b4de23 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 @@ -76,7 +76,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math
{{jsxref("Global_Objects/Math/cosh", "Math.cosh(x)")}}
Returns the hyperbolic cosine of a number.
{{jsxref("Global_Objects/Math/exp", "Math.exp(x)")}}
-
回傳 Ex,x 為給定數值,E 為歐拉常數 (自然對數的底數)。
+
回傳 E^x,x 為給定數值,E 為歐拉常數 (自然對數的底數)。
{{jsxref("Global_Objects/Math/expm1", "Math.expm1(x)")}}
回傳 exp(x) 減去1的值。
{{jsxref("Global_Objects/Math/floor", "Math.floor(x)")}}
@@ -100,7 +100,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math
{{jsxref("Global_Objects/Math/min", "Math.min([x[, y[, …]]])")}}
回傳給定數值中的最小值。
{{jsxref("Global_Objects/Math/pow", "Math.pow(x, y)")}}
-
回傳 x 的 y 次方,也就是 xy
+
回傳 x 的 y 次方,也就是 x^y
{{jsxref("Global_Objects/Math/random", "Math.random()")}}
回傳一個 0 到 1 之間的偽隨機值。
{{jsxref("Global_Objects/Math/round", "Math.round(x)")}}
diff --git a/files/zh-tw/web/javascript/reference/global_objects/math/pow/index.html b/files/zh-tw/web/javascript/reference/global_objects/math/pow/index.html index 7119ba5862..4fedac7ef7 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/math/pow/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/math/pow/index.html @@ -7,7 +7,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math/pow ---
{{JSRef}}
-

Math.pow() 函式回傳 baseexponent 次方(幂)值,也就是 baseexponent

+

Math.pow() 函式回傳 baseexponent 次方(幂)值,也就是 base^exponent

語法

@@ -28,7 +28,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math/pow

敘述

-

The Math.pow() function returns the base to the exponent power, that is, baseexponent, the base and the exponent are in decimal numeral system.

+

The Math.pow() function returns the base to the exponent power, that is, base^exponent, the base and the exponent are in decimal numeral system.

由於 pow()Math 的靜態方法,you always use it as Math.pow(), rather than as a method of a Math object you created(Math 並沒有建構子)。

diff --git a/files/zh-tw/web/javascript/reference/global_objects/math/random/index.html b/files/zh-tw/web/javascript/reference/global_objects/math/random/index.html index 896d4ab948..6731d1c2b4 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/math/random/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/math/random/index.html @@ -26,7 +26,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math/random

範例

-

請留意JavaScript中的數字與許多語言一樣使用 IEEE 754 floating point numbers with round-to-nearest-even behavior, the ranges claimed for the functions below (excluding the one for Math.random() itself) aren't exact. If extremely large bounds are chosen (253 or higher), it's possible in extremely rare cases to calculate the usually-excluded upper bound.

+

請留意JavaScript中的數字與許多語言一樣使用 IEEE 754 floating point numbers with round-to-nearest-even behavior, the ranges claimed for the functions below (excluding the one for Math.random() itself) aren't exact. If extremely large bounds are chosen (2^53 or higher), it's possible in extremely rare cases to calculate the usually-excluded upper bound.

Getting a random number between 0 (inclusive) and 1 (exclusive)

diff --git a/files/zh-tw/web/javascript/reference/global_objects/number/index.html b/files/zh-tw/web/javascript/reference/global_objects/number/index.html index 6aad23d489..cda3475d0b 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/number/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/number/index.html @@ -39,11 +39,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Number
{{jsxref("Number.EPSILON")}}
介於1和大於1的最小值之可表示的差。
{{jsxref("Number.MAX_SAFE_INTEGER")}}
-
JavaScript 中 IEEE-754 雙精度範圍間的最大整數 (253 - 1) 。
+
JavaScript 中 IEEE-754 雙精度範圍間的最大整數 (2^53 - 1) 。
{{jsxref("Number.MAX_VALUE")}}
可表示的最大正整數。
{{jsxref("Number.MIN_SAFE_INTEGER")}}
-
JavaScript 中 IEEE-754 雙精度範圍間的最小整數 (-(253 - 1)) 。
+
JavaScript 中 IEEE-754 雙精度範圍間的最小整數 (-(2^53 - 1)) 。
{{jsxref("Number.MIN_VALUE")}}
可表示的最小值,即最靠近0的正整數?(5.00×103245.00\times10^{324})。
{{jsxref("Number.NaN")}}
@@ -66,7 +66,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Number
{{jsxref("Number.isInteger()")}}
判斷傳入的值是不是一個整數。
{{jsxref("Number.isSafeInteger()")}}
-
判斷傳入的值是不是在 IEEE-754 雙精度範圍間 (即介於 -(253 - 1) 和 253 - 1之前)。
+
判斷傳入的值是不是在 IEEE-754 雙精度範圍間 (即介於 -(2^53 - 1) 和 2^53 - 1之前)。
{{jsxref("Number.toInteger()")}} {{obsolete_inline}}
被用來評估傳入的值且將其轉換成整數 (或 {{jsxref("Global_Objects/Infinity", "Infinity")}}) 但已被移除。
{{jsxref("Number.parseFloat()")}}
diff --git a/files/zh-tw/web/javascript/reference/global_objects/typedarray/index.html b/files/zh-tw/web/javascript/reference/global_objects/typedarray/index.html index f37e7ac069..49be1c3db0 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/typedarray/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/typedarray/index.html @@ -149,7 +149,7 @@ Int8Array.prototype.foo = 'bar'; {{jsxref("Float32Array")}} - 1.2x10-38 to 3.4x1038 + 1.2x10^-38 to 3.4x10^38 4 32-bit IEEE floating point number ( 7 significant digits e.g. 1.1234567) unrestricted float @@ -157,7 +157,7 @@ Int8Array.prototype.foo = 'bar'; {{jsxref("Float64Array")}} - 5.0x10-324 to 1.8x10308 + 5.0x10^-324 to 1.8x10^308 8 64-bit IEEE floating point number (16 significant digits e.g. 1.123...15) unrestricted double -- cgit v1.2.3-54-g00ecf