From 12a899ab8540bc84f56a0dc6491be80a48499d49 Mon Sep 17 00:00:00 2001 From: t7yang Date: Mon, 10 Jan 2022 08:38:07 +0800 Subject: remove name attribute for zh-TW --- .../web/javascript/reference/statements/for...in/index.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'files/zh-tw/web/javascript/reference/statements') diff --git a/files/zh-tw/web/javascript/reference/statements/for...in/index.html b/files/zh-tw/web/javascript/reference/statements/for...in/index.html index 2c903faf2e..92ab3aa5c0 100644 --- a/files/zh-tw/web/javascript/reference/statements/for...in/index.html +++ b/files/zh-tw/web/javascript/reference/statements/for...in/index.html @@ -5,7 +5,7 @@ translation_of: Web/JavaScript/Reference/Statements/for...in ---

{{jsSidebar("Statements")}}

-

Summary

+

Summary

迭代物件的可列舉屬性。對每個相異屬性,執行陳述式。

@@ -27,12 +27,12 @@ translation_of: Web/JavaScript/Reference/Statements/for...in -

語法

+

語法

for (變數 in 物件) {...
 }
-

參數

+

參數

變數
@@ -41,7 +41,7 @@ translation_of: Web/JavaScript/Reference/Statements/for...in
Object whose enumerable properties are iterated.
-

Description

+

Description

for...in 迴圈只迭代可列舉屬性。由內建建構式(如:Array、Object) 製造的物件,從 Object.prototypeString.prototype 繼承了不可列舉屬性,如: StringindexOf 方法,或 ObjecttoString 方法。 迴圈將迭代全部可列舉屬性,包括了物件自身的和物件繼承自它的建構式之原型的可列舉屬性。(原型鏈上較接近物件的屬性覆蓋原型的屬性)

@@ -57,7 +57,7 @@ translation_of: Web/JavaScript/Reference/Statements/for...in

因為迭代的順序依賴於 JavaScript 引擎的實作,在不同引擎下,迭代一個陣列可能不是以一個一致的順序存取陣列元素。因此,當你迭代陣列,且該陣列的存取順序很重要時,最好是使用以數值索引的 for 迴圈 (或 Array.forEach 或非標準 for...of 迴圈)。

-

Examples

+

Examples

The following function takes as its arguments an object and the object's name. It then iterates over all the object's enumerable properties and returns a string of the property names and their values.

@@ -102,7 +102,7 @@ o = new ColoredTriangle(); alert(show_own_props(o, "o")); /* alerts: o.color = red */ -

See also

+

See also