aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/web/javascript/reference/global_objects/array
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-tw/web/javascript/reference/global_objects/array')
-rw-r--r--files/zh-tw/web/javascript/reference/global_objects/array/index.html2
-rw-r--r--files/zh-tw/web/javascript/reference/global_objects/array/length/index.html6
2 files changed, 4 insertions, 4 deletions
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(<var>arrayLength</var>)</pre>
<dd>除了只傳遞一個參數給 <code>Array</code> 構造函數,且該參數為一個數字的情況(詳見下方的 arrayLength 參數),JavaScript 陣列會以傳入的元素進行初始化。</dd>
<dd>請注意,這種特殊情況僅適用於以 <code>Array </code>構造函數建立的 JavaScript 陣列,而不適用於以括號語法建立的陣列常值(Array Literals)。</dd>
<dt><code>arrayLength</code></dt>
- <dd>如果傳遞給 <code>Array</code> 構造函數的唯一參數是 0 和 2<sup>32</sup>-1(含)之間的整數,將回傳一個新的 JavaScript 陣列,其長度被設定為這個數字。如果參數是任何其他數值,將拋出 {{jsxref("RangeError")}} 異常。</dd>
+ <dd>如果傳遞給 <code>Array</code> 構造函數的唯一參數是 0 和 2^32 - 1(含)之間的整數,將回傳一個新的 JavaScript 陣列,其長度被設定為這個數字。如果參數是任何其他數值,將拋出 {{jsxref("RangeError")}} 異常。</dd>
</dl>
<h2 id="Description">說明</h2>
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;
<h2 id="描述">描述</h2>
-<p><code>length</code> 屬性的值必為一正整數,其值必介於 0 ~ 2<sup>32</sup> (不包含)之間.</p>
+<p><code>length</code> 屬性的值必為一正整數,其值必介於 0 ~ 2^32 (不包含)之間.</p>
-<pre class="brush: js">var namelistA = new Array(4294967296); //2<sup>32</sup><sup> = </sup>4294967296
+<pre class="brush: js">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 ~ 2<sup>32 </sup>-1
+namelistB.length = Math.pow(2,32)-1; //將長度設定介於 0 ~ 2^32 -1
console.log(namelistB.length);
//4294967295</pre>