From 89d3e9a50c92c4ba16655c2cba101705bc5d5dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=93=E9=9D=9242?= <335121817@qq.com> Date: Tue, 1 Sep 2026 17:27:32 +0800 Subject: [PATCH 1/6] translate lang to zh-cn zh-tw MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 菜单补充 object keys 的中文翻译 翻译 object keys 题目的繁体中文版 翻译 object keys 题目的简体中文版 --- problems/object-keys/problem_zh-cn.md | 19 +++++++++---------- problems/object-keys/problem_zh-tw.md | 19 +++++++++---------- problems/object-keys/solution_zh-cn.md | 8 ++++---- problems/object-keys/solution_zh-tw.md | 8 ++++---- 4 files changed, 26 insertions(+), 28 deletions(-) diff --git a/problems/object-keys/problem_zh-cn.md b/problems/object-keys/problem_zh-cn.md index 1b07c63f..8c0d2869 100644 --- a/problems/object-keys/problem_zh-cn.md +++ b/problems/object-keys/problem_zh-cn.md @@ -1,7 +1,6 @@ -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. +JavaScript 提供了一种原生的方式,用来列出对象的所有键(keys)。当你需要遍历对象的所有属性并相应地操作它们的值时,这会很有用。 -Here's an example of listing all object keys using the **Object.keys()** -prototype method. +下面是一个使用 **Object.keys()** 原型方法来列出对象所有键的例子。 ```js const car = { @@ -14,13 +13,13 @@ const keys = Object.keys(car) console.log(keys) ``` -The above code will print an array of strings, where each string is a key in the car object. `['make', 'model', 'year']` +上面的代码会打印一个字符串数组,其中每个字符串都是 car 对象中的一个键。`['make', 'model', 'year']` -## The challenge: +## 挑战任务: -Create a file named `object-keys.js`. +创建一个名为 `object-keys.js` 的文件。 -In that file, define a variable named `car` like this: +在该文件中,像这样定义一个名为 `car` 的变量: ```js const car = { @@ -30,14 +29,14 @@ const car = { } ``` -Then define another variable named `keys` like this: +然后像这样定义另一个名为 `keys` 的变量: ```js const keys = Object.keys(car) ``` -Use `console.log()` to print the `keys` variable to the terminal. +使用 `console.log()` 将 `keys` 变量打印到终端。 -Check to see if your program is correct by running this command: +通过运行以下命令来检查你的程序是否正确: ```bash javascripting verify object-keys.js diff --git a/problems/object-keys/problem_zh-tw.md b/problems/object-keys/problem_zh-tw.md index 1b07c63f..d06e7e83 100644 --- a/problems/object-keys/problem_zh-tw.md +++ b/problems/object-keys/problem_zh-tw.md @@ -1,7 +1,6 @@ -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. +JavaScript 提供了一種原生的方式,用來列出物件(object)的所有鍵(keys)。當你需要遍歷物件的所有屬性並據此操作它們的值時,這會很有用。 -Here's an example of listing all object keys using the **Object.keys()** -prototype method. +下面是一個使用 **Object.keys()** 原型方法來列出物件所有鍵的範例。 ```js const car = { @@ -14,13 +13,13 @@ const keys = Object.keys(car) console.log(keys) ``` -The above code will print an array of strings, where each string is a key in the car object. `['make', 'model', 'year']` +上面的程式碼會印出一個字串陣列,其中每個字串都是 car 物件中的一個鍵。`['make', 'model', 'year']` -## The challenge: +## 挑戰任務: -Create a file named `object-keys.js`. +建立一個名為 `object-keys.js` 的檔案。 -In that file, define a variable named `car` like this: +在該檔案中,像這樣定義一個名為 `car` 的變數: ```js const car = { @@ -30,14 +29,14 @@ const car = { } ``` -Then define another variable named `keys` like this: +然後像這樣定義另一個名為 `keys` 的變數: ```js const keys = Object.keys(car) ``` -Use `console.log()` to print the `keys` variable to the terminal. +使用 `console.log()` 將 `keys` 變數印到終端機。 -Check to see if your program is correct by running this command: +透過執行以下指令來檢查你的程式是否正確: ```bash javascripting verify object-keys.js diff --git a/problems/object-keys/solution_zh-cn.md b/problems/object-keys/solution_zh-cn.md index 0f3540ea..8a9921be 100644 --- a/problems/object-keys/solution_zh-cn.md +++ b/problems/object-keys/solution_zh-cn.md @@ -1,11 +1,11 @@ --- -# CORRECT. +# 正确! -Good job using the Object.keys() prototype method. Remember to use it when you need to list the keys of an object. +很好,你使用了 Object.keys() 原型方法。当你需要列出对象的键时,记得使用它。 -The next challenge is all about **functions**. +下一个挑战是关于**函数(functions)**的。 -Run `javascripting` in the console to choose the next challenge. +在控制台中运行 `javascripting` 来选择下一个挑战。 --- diff --git a/problems/object-keys/solution_zh-tw.md b/problems/object-keys/solution_zh-tw.md index 0f3540ea..f05b7c18 100644 --- a/problems/object-keys/solution_zh-tw.md +++ b/problems/object-keys/solution_zh-tw.md @@ -1,11 +1,11 @@ --- -# CORRECT. +# 正確! -Good job using the Object.keys() prototype method. Remember to use it when you need to list the keys of an object. +很好,你使用了 Object.keys() 原型方法。當你需要列出物件的鍵時,記得使用它。 -The next challenge is all about **functions**. +下一個挑戰是關於**函式(functions)**的。 -Run `javascripting` in the console to choose the next challenge. +在終端機執行 `javascripting` 來選擇下一個挑戰。 --- From f1d85263254757876e82349d0ecdca9026d544b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=93=E9=9D=9242?= <335121817@qq.com> Date: Tue, 1 Sep 2026 17:28:50 +0800 Subject: [PATCH 2/6] Fix formatting of text in solution_zh-cn.md --- problems/object-keys/solution_zh-cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problems/object-keys/solution_zh-cn.md b/problems/object-keys/solution_zh-cn.md index 8a9921be..4e21cd39 100644 --- a/problems/object-keys/solution_zh-cn.md +++ b/problems/object-keys/solution_zh-cn.md @@ -4,7 +4,7 @@ 很好,你使用了 Object.keys() 原型方法。当你需要列出对象的键时,记得使用它。 -下一个挑战是关于**函数(functions)**的。 +下一个挑战是关于 **函数(functions)** 的。 在控制台中运行 `javascripting` 来选择下一个挑战。 From 16479b60fc106d41b5a5cd710431063980e4a379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=93=E9=9D=9242?= <335121817@qq.com> Date: Tue, 1 Sep 2026 17:30:21 +0800 Subject: [PATCH 3/6] Fix formatting of text in solution_zh-tw.md --- problems/object-keys/solution_zh-tw.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problems/object-keys/solution_zh-tw.md b/problems/object-keys/solution_zh-tw.md index f05b7c18..c18b45e6 100644 --- a/problems/object-keys/solution_zh-tw.md +++ b/problems/object-keys/solution_zh-tw.md @@ -4,7 +4,7 @@ 很好,你使用了 Object.keys() 原型方法。當你需要列出物件的鍵時,記得使用它。 -下一個挑戰是關於**函式(functions)**的。 +下一個挑戰是關於 **函式(functions)** 的。 在終端機執行 `javascripting` 來選擇下一個挑戰。 From 3c9d71fac9c13b1ea38621905eec1a145d749641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=93=E9=9D=9242?= <335121817@qq.com> Date: Tue, 1 Sep 2026 17:31:08 +0800 Subject: [PATCH 4/6] translate object keys to zh-cn zh-tw --- i18n/zh-cn.json | 1 + i18n/zh-tw.json | 1 + 2 files changed, 2 insertions(+) diff --git a/i18n/zh-cn.json b/i18n/zh-cn.json index 8a9ce439..133a19d3 100644 --- a/i18n/zh-cn.json +++ b/i18n/zh-cn.json @@ -16,6 +16,7 @@ , "LOOPING THROUGH ARRAYS": "依次访问数组中的值" , "OBJECTS": "对象" , "OBJECT PROPERTIES": "对象的属性" + , "OBJECT KEYS": "对象的键" , "FUNCTIONS": "函数" , "FUNCTION ARGUMENTS": "函数的参数" , "SCOPE": "作用域" diff --git a/i18n/zh-tw.json b/i18n/zh-tw.json index 26d244b7..a9300c41 100644 --- a/i18n/zh-tw.json +++ b/i18n/zh-tw.json @@ -16,6 +16,7 @@ , "LOOPING THROUGH ARRAYS": "以迴圈存取陣列中的值" , "OBJECTS": "物件" , "OBJECT PROPERTIES": "物件的屬性" + , "OBJECT KEYS": "物件的鍵" , "FUNCTIONS": "函式" , "FUNCTION ARGUMENTS": "函式的參數" , "SCOPE": "作用域" From ff3c9dbe173d2c228d72f84df0afc0a943f55dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=93=E9=9D=9242?= <335121817@qq.com> Date: Tue, 1 Sep 2026 17:46:26 +0800 Subject: [PATCH 5/6] Update problem_zh-cn.md with code insertion task Add instructions for inserting code to achieve specific output. --- problems/scope/problem_zh-cn.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/problems/scope/problem_zh-cn.md b/problems/scope/problem_zh-cn.md index f8c2ab4f..074329e8 100644 --- a/problems/scope/problem_zh-cn.md +++ b/problems/scope/problem_zh-cn.md @@ -60,3 +60,9 @@ const a = 1; const b = 2; const c = 3; ```js console.log(`a: ${a}, b: ${b}, c: ${c}`); ``` + +通过运行以下命令检查你的程序是否正确: + +```bash +javascripting verify scope.js +``` From f6eb64f3ac8020a9ea096fb5b826e770a9f57b53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=93=E9=9D=9242?= <335121817@qq.com> Date: Tue, 1 Sep 2026 17:46:57 +0800 Subject: [PATCH 6/6] Update problem_zh-tw.md with verification instructions Add instructions for verifying the scope problem. --- problems/scope/problem_zh-tw.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/problems/scope/problem_zh-tw.md b/problems/scope/problem_zh-tw.md index d544fd62..f3c4d0a7 100644 --- a/problems/scope/problem_zh-tw.md +++ b/problems/scope/problem_zh-tw.md @@ -60,3 +60,9 @@ const a = 1; const b = 2; const c = 3; ```js console.log(`a: ${a}, b: ${b}, c: ${c}`); ``` + +透過執行以下指令來檢查你的程式是否正確: + +```bash +javascripting verify scope.js +```