From 584d552de4d1d273a9f858fb7b81dbe7570ab0ce Mon Sep 17 00:00:00 2001 From: Victor Lin Date: Mon, 22 Oct 2018 10:40:57 -0700 Subject: [PATCH] Added some translations Added some translations --- .../javascript/loops/for-in-loop/index.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/guide/chinese/javascript/loops/for-in-loop/index.md b/guide/chinese/javascript/loops/for-in-loop/index.md index da2574a17f..82999451c2 100644 --- a/guide/chinese/javascript/loops/for-in-loop/index.md +++ b/guide/chinese/javascript/loops/for-in-loop/index.md @@ -9,14 +9,12 @@ for (variable in object) { } ``` -|必需/可选|参数|说明| | ------------------- | ----------- | ----------------- -------------------------------------------------- --- | |必需|变量|每次迭代都会为变量分配不同的属性名称。 | |可选|对象|迭代其可枚举属性的对象。 | - ## 例子 ``` -// Initialize object. +// 初始一個物件. a = { "a": "Athens", "b": "Belgrade", "c": "Cairo" } - // Iterate over the properties. + // 迭代对象的可枚举属性. var s = "" for (var key in a) { s += key + ": " + a[key]; @@ -24,15 +22,15 @@ for (variable in object) { } document.write (s); - // Output: + // 輸出: // a: Athens // b: Belgrade // c: Cairo - // Initialize the array. + // 初始化陣列. var arr = new Array("zero", "one", "two"); - // Add a few expando properties to the array. + // 新增属性至陣列. arr["orange"] = "fruit"; arr["carrot"] = "vegetable"; @@ -45,7 +43,7 @@ for (variable in object) { document.write (s); - // Output: + // 輸出: // 0: zero // 1: one // 2: two @@ -58,7 +56,7 @@ for (variable in object) { document.write(myKeys); - //Output: + //輸出: // a // b // c @@ -67,4 +65,4 @@ for (variable in object) { # 资源: * [MDN链接](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for…in) -* [MSDN链接](https://msdn.microsoft.com/library/55wb2d34.aspx) \ No newline at end of file +* [MSDN链接](https://msdn.microsoft.com/library/55wb2d34.aspx)