Skip to content

Commit 8ce10b0

Browse files
authored
Merge pull request #372 from DHclly/fix-01
Translate object keys and update problem documents for zh-cn and zh-tw
2 parents ac44b49 + f6eb64f commit 8ce10b0

8 files changed

Lines changed: 40 additions & 28 deletions

File tree

i18n/zh-cn.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
, "LOOPING THROUGH ARRAYS": "依次访问数组中的值"
1717
, "OBJECTS": "对象"
1818
, "OBJECT PROPERTIES": "对象的属性"
19+
, "OBJECT KEYS": "对象的键"
1920
, "FUNCTIONS": "函数"
2021
, "FUNCTION ARGUMENTS": "函数的参数"
2122
, "SCOPE": "作用域"

i18n/zh-tw.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
, "LOOPING THROUGH ARRAYS": "以迴圈存取陣列中的值"
1717
, "OBJECTS": "物件"
1818
, "OBJECT PROPERTIES": "物件的屬性"
19+
, "OBJECT KEYS": "物件的鍵"
1920
, "FUNCTIONS": "函式"
2021
, "FUNCTION ARGUMENTS": "函式的參數"
2122
, "SCOPE": "作用域"

problems/object-keys/problem_zh-cn.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
JavaScript provides a native way of listing all the available keys of an object. This can be helpful for looping through all the properties of an object and manipulating their values accordingly.
1+
JavaScript 提供了一种原生的方式,用来列出对象的所有键(keys)。当你需要遍历对象的所有属性并相应地操作它们的值时,这会很有用。
22

3-
Here's an example of listing all object keys using the **Object.keys()**
4-
prototype method.
3+
下面是一个使用 **Object.keys()** 原型方法来列出对象所有键的例子。
54

65
```js
76
const car = {
@@ -14,13 +13,13 @@ const keys = Object.keys(car)
1413
console.log(keys)
1514
```
1615

17-
The above code will print an array of strings, where each string is a key in the car object. `['make', 'model', 'year']`
16+
上面的代码会打印一个字符串数组,其中每个字符串都是 car 对象中的一个键。`['make', 'model', 'year']`
1817

19-
## The challenge:
18+
## 挑战任务:
2019

21-
Create a file named `object-keys.js`.
20+
创建一个名为 `object-keys.js` 的文件。
2221

23-
In that file, define a variable named `car` like this:
22+
在该文件中,像这样定义一个名为 `car` 的变量:
2423

2524
```js
2625
const car = {
@@ -30,14 +29,14 @@ const car = {
3029
}
3130
```
3231

33-
Then define another variable named `keys` like this:
32+
然后像这样定义另一个名为 `keys` 的变量:
3433
```js
3534
const keys = Object.keys(car)
3635
```
3736

38-
Use `console.log()` to print the `keys` variable to the terminal.
37+
使用 `console.log()` `keys` 变量打印到终端。
3938

40-
Check to see if your program is correct by running this command:
39+
通过运行以下命令来检查你的程序是否正确:
4140

4241
```bash
4342
javascripting verify object-keys.js

problems/object-keys/problem_zh-tw.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
JavaScript provides a native way of listing all the available keys of an object. This can be helpful for looping through all the properties of an object and manipulating their values accordingly.
1+
JavaScript 提供了一種原生的方式,用來列出物件(object)的所有鍵(keys)。當你需要遍歷物件的所有屬性並據此操作它們的值時,這會很有用。
22

3-
Here's an example of listing all object keys using the **Object.keys()**
4-
prototype method.
3+
下面是一個使用 **Object.keys()** 原型方法來列出物件所有鍵的範例。
54

65
```js
76
const car = {
@@ -14,13 +13,13 @@ const keys = Object.keys(car)
1413
console.log(keys)
1514
```
1615

17-
The above code will print an array of strings, where each string is a key in the car object. `['make', 'model', 'year']`
16+
上面的程式碼會印出一個字串陣列,其中每個字串都是 car 物件中的一個鍵。`['make', 'model', 'year']`
1817

19-
## The challenge:
18+
## 挑戰任務:
2019

21-
Create a file named `object-keys.js`.
20+
建立一個名為 `object-keys.js` 的檔案。
2221

23-
In that file, define a variable named `car` like this:
22+
在該檔案中,像這樣定義一個名為 `car` 的變數:
2423

2524
```js
2625
const car = {
@@ -30,14 +29,14 @@ const car = {
3029
}
3130
```
3231

33-
Then define another variable named `keys` like this:
32+
然後像這樣定義另一個名為 `keys` 的變數:
3433
```js
3534
const keys = Object.keys(car)
3635
```
3736

38-
Use `console.log()` to print the `keys` variable to the terminal.
37+
使用 `console.log()` `keys` 變數印到終端機。
3938

40-
Check to see if your program is correct by running this command:
39+
透過執行以下指令來檢查你的程式是否正確:
4140

4241
```bash
4342
javascripting verify object-keys.js
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22

3-
# CORRECT.
3+
# 正确!
44

5-
Good job using the Object.keys() prototype method. Remember to use it when you need to list the keys of an object.
5+
很好,你使用了 Object.keys() 原型方法。当你需要列出对象的键时,记得使用它。
66

7-
The next challenge is all about **functions**.
7+
下一个挑战是关于 **函数(functions)** 的。
88

9-
Run `javascripting` in the console to choose the next challenge.
9+
在控制台中运行 `javascripting` 来选择下一个挑战。
1010

1111
---
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22

3-
# CORRECT.
3+
# 正確!
44

5-
Good job using the Object.keys() prototype method. Remember to use it when you need to list the keys of an object.
5+
很好,你使用了 Object.keys() 原型方法。當你需要列出物件的鍵時,記得使用它。
66

7-
The next challenge is all about **functions**.
7+
下一個挑戰是關於 **函式(functions)** 的。
88

9-
Run `javascripting` in the console to choose the next challenge.
9+
在終端機執行 `javascripting` 來選擇下一個挑戰。
1010

1111
---

problems/scope/problem_zh-cn.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,9 @@ const a = 1; const b = 2; const c = 3;
6060
```js
6161
console.log(`a: ${a}, b: ${b}, c: ${c}`);
6262
```
63+
64+
通过运行以下命令检查你的程序是否正确:
65+
66+
```bash
67+
javascripting verify scope.js
68+
```

problems/scope/problem_zh-tw.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,9 @@ const a = 1; const b = 2; const c = 3;
6060
```js
6161
console.log(`a: ${a}, b: ${b}, c: ${c}`);
6262
```
63+
64+
透過執行以下指令來檢查你的程式是否正確:
65+
66+
```bash
67+
javascripting verify scope.js
68+
```

0 commit comments

Comments
 (0)