Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.
Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.
@@ -69,9 +69,9 @@ assert(
- Click here to view more cat photos.
+ Click here to view more cat photos.
-
+
Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.
Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.
@@ -50,7 +50,7 @@ assert($('a').attr('href') === '#');
Click here to view more cat photos.
-
+
Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.
Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.
diff --git a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/nest-an-anchor-element-within-a-paragraph.md b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/nest-an-anchor-element-within-a-paragraph.md
index c3c141cfdc..5db345d570 100644
--- a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/nest-an-anchor-element-within-a-paragraph.md
+++ b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/nest-an-anchor-element-within-a-paragraph.md
@@ -2,7 +2,6 @@
id: bad87fee1348bd9aede08817
title: 将 a 嵌套在段落中
challengeType: 0
-videoUrl: 'https://scrimba.com/p/pVMPUv/cb6k8Cb'
forumTopicId: 18244
dashedName: nest-an-anchor-element-within-a-paragraph
---
@@ -13,7 +12,7 @@ dashedName: nest-an-anchor-element-within-a-paragraph
```html
- Here's a link to freecodecamp.org for you to follow.
+ Here's a link to www.freecodecamp.org for you to follow.
```
@@ -32,18 +31,18 @@ dashedName: nest-an-anchor-element-within-a-paragraph
`target` 是锚点元素的一个属性,它用来指定链接的打开方式。 属性值 `_blank` 表示链接会在新标签页打开。 `href` 是锚点元素的另一个属性,它用来指定链接的 URL:
```html
- ...
+ ...
```
-`a` 元素内的文本 `link to freecodecamp.org` 叫作锚文本,会显示为一个可以点击的链接:
+`a` 元素内的文本 `link to www.freecodecamp.org` 叫作锚文本,会显示为一个可以点击的链接:
```html
-link to freecodecamp.org
+link to freecodecamp.org
```
此示例的最终输出结果是这样:
-Here's a [link to freecodecamp.org](http://freecodecamp.org) for you to follow.
+你可以访问 link to www.freecodecamp.org。
# --instructions--
@@ -59,11 +58,11 @@ assert(
);
```
-`a` 元素应该链接到 “`https://freecatphotoapp.com`”。
+`a` 元素应该链接到 “`https://www.freecatphotoapp.com`”。
```js
assert(
- $('a[href="https://freecatphotoapp.com"]').length === 1
+ $('a[href="https://www.freecatphotoapp.com"]').length === 1
);
```
@@ -87,7 +86,7 @@ assert($('p') && $('p').length > 2);
```js
assert(
- $('a[href="https://freecatphotoapp.com"]').parent().is('p')
+ $('a[href="https://www.freecatphotoapp.com"]').parent().is('p')
);
```
@@ -95,7 +94,7 @@ assert(
```js
assert(
- $('a[href="https://freecatphotoapp.com"]')
+ $('a[href="https://www.freecatphotoapp.com"]')
.parent()
.text()
.match(/View\smore\s/gi)
@@ -140,9 +139,9 @@ assert(
CatPhotoApp
- cat photos
+ cat photos
-
+
Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.
Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.
@@ -154,9 +153,9 @@ assert(
```html
CatPhotoApp
- View more cat photos
+ View more cat photos
-
+
Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.
Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/access-multi-dimensional-arrays-with-indexes.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/access-multi-dimensional-arrays-with-indexes.md
index 6930f32e3d..4c81c928bb 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/access-multi-dimensional-arrays-with-indexes.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/access-multi-dimensional-arrays-with-indexes.md
@@ -27,7 +27,7 @@ arr[3][0][1];
`arr[3]` 为 `[[10, 11, 12], 13, 14]`,`arr[3][0]` 为 `[10, 11, 12]`,并且 `arr[3][0][1]` 为 `11`。
-**注意:** 数组名与方括号之间不应该有任何空格,比如`array [0][0]` 甚至是 `array [0] [0]` 都是不允许的。 尽管 JavaScript 能够正确处理这种情况,但是当其他程序员阅读你写的代码时,这可能让他们感到困惑。
+**注意:** 数组名与方括号之间不应该有任何空格,比如 `array [0][0]` 甚至是 `array [0] [0]` 都是不允许的。 尽管 JavaScript 能够正确处理这种情况,但是当其他程序员阅读你写的代码时,这可能让他们感到困惑。
# --instructions--
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-nested-arrays.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-nested-arrays.md
index fcc84457c8..5bc88691fa 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-nested-arrays.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-nested-arrays.md
@@ -40,7 +40,7 @@ ourPets[1].names[0];
# --instructions--
-使用对象的点号和数组的方括号从变量 `myPlants` 检索出第二棵树。
+使用点和方括号,将变量 `secondTree` 的值设置为 `myPlants` 对象中 `trees` 列表的第二个项目。
# --hints--
@@ -72,7 +72,6 @@ assert(/=\s*myPlants\[1\].list\[1\]/.test(code));
## --seed-contents--
```js
-// Setup
var myPlants = [
{
type: "flowers",
@@ -92,9 +91,7 @@ var myPlants = [
}
];
-// Only change code below this line
-
-var secondTree = ""; // Change this line
+var secondTree = "";
```
# --solutions--
@@ -119,7 +116,5 @@ var myPlants = [
}
];
-// Only change code below this line
-
var secondTree = myPlants[1].list[1];
```
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/add-new-properties-to-a-javascript-object.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/add-new-properties-to-a-javascript-object.md
index c675f544a7..8657efc29d 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/add-new-properties-to-a-javascript-object.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/add-new-properties-to-a-javascript-object.md
@@ -50,7 +50,7 @@ ourDog.bark = "bow-wow";
assert(myDog.bark !== undefined);
```
-不应该在初始化部分添加 `bark`。
+不应该在 `myDog` 的初始化中添加 `bark`。
```js
assert(!/bark[^\n]:/.test(code));
@@ -67,7 +67,6 @@ assert(!/bark[^\n]:/.test(code));
## --seed-contents--
```js
-// Setup
var myDog = {
"name": "Happy Coder",
"legs": 4,
@@ -75,7 +74,7 @@ var myDog = {
"friends": ["freeCodeCamp Campers"]
};
-// Only change code below this line
+
```
# --solutions--
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/comment-your-javascript-code.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/comment-your-javascript-code.md
index e8ac778514..f56f0a3d24 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/comment-your-javascript-code.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/comment-your-javascript-code.md
@@ -20,7 +20,7 @@ JavaScript有两种写注释的方法。
// This is an in-line comment.
```
-你也可以使用多行注释来注释你的代码,使用 `/*` 开始, `*/` 结束. 这是一个多行注释:
+你也可以使用多行注释来注释你的代码,使用 `/*` 开始, `*/` 结束。 这是一个多行注释:
```js
/* This is a
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-plus-operator.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-plus-operator.md
index 87f55cf977..2c6ce8b212 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-plus-operator.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-plus-operator.md
@@ -17,7 +17,7 @@ dashedName: concatenating-strings-with-plus-operator
'My name is Alan,' + ' I concatenate.'
```
-**提示:**注意空格。 拼接操作不会在两个字符串之间添加空格。所以,如果想加上空格的话,你需要自己在字符串里面添加。
+**提示:** 注意空格。 拼接操作不会在两个字符串之间添加空格。所以,如果想加上空格的话,你需要自己在字符串里面添加。
例如:
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-the-plus-equals-operator.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-the-plus-equals-operator.md
index c963cb952a..52a1e8b261 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-the-plus-equals-operator.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-the-plus-equals-operator.md
@@ -11,7 +11,7 @@ dashedName: concatenating-strings-with-the-plus-equals-operator
我们还可以使用 `+=` 运算符来拼接字符串到现有字符串变量的结尾。 对于那些被分割成几段的长的字符串来说,这一操作是非常有用的。
-**提示:**注意空格。 拼接操作不会在两个字符串之间添加空格,所以,如果想要加上空格的话,你需要自己在字符串里面添加。
+**提示:** 注意空格。 拼接操作不会在两个字符串之间添加空格,所以,如果想要加上空格的话,你需要自己在字符串里面添加。
例如:
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/create-decimal-numbers-with-javascript.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/create-decimal-numbers-with-javascript.md
index aa518f3b80..f3d062f266 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/create-decimal-numbers-with-javascript.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/create-decimal-numbers-with-javascript.md
@@ -11,7 +11,7 @@ dashedName: create-decimal-numbers-with-javascript
我们也可以把小数存储到变量中。 小数有时候也被称作浮点数或者 floats。
-**提示:**不是所有的实数都可以用浮点数(floating point)来表示。 因为可能产生四舍五入的错误, [查看详情](https://en.wikipedia.org/wiki/Floating_point#Accuracy_problems)。
+**提示:** 不是所有的实数都可以用浮点数(floating point)来表示。 因为可能产生四舍五入的错误, [查看详情](https://en.wikipedia.org/wiki/Floating_point#Accuracy_problems)。
# --instructions--
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-through-an-array-with-a-for-loop.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-through-an-array-with-a-for-loop.md
index 8623890917..335f7fcdf3 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-through-an-array-with-a-for-loop.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-through-an-array-with-a-for-loop.md
@@ -18,7 +18,7 @@ for (var i = 0; i < arr.length; i++) {
}
```
-记住数组的索引从零开始的,这意味着数组的最后一个元素的下标是:`length - 1`(数组的长度 -1)。 我们这个循环的条件是 `i < arr.length`,当 `i` 的值为 `length` 的时候循环就停止了。 在这个例子中,最后一个循环是 `i === 4`,也就是说,当 `i` 的值等于 `arr.length` 时,结果输出 `6`。
+记住数组的索引从零开始的,这意味着数组的最后一个元素的下标是:`length - 1`(数组的长度 -1)。 我们这个循环的条件是 `i < arr.length`,当 `i` 的值为 `length` 的时候循环就停止了。 在这个例子中,最后一个循环是 `i === 4`,也就是说,当 `i` 的值等于 `arr.length - 1` 时,结果输出 `6`。 然后 `i` 增加到 `5`,循环会终止,因为 `i < arr.length` 是 `false`。
# --instructions--
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/manipulating-complex-objects.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/manipulating-complex-objects.md
index c3beb55a78..bae32889b3 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/manipulating-complex-objects.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/manipulating-complex-objects.md
@@ -59,65 +59,69 @@ var ourMusic = [
assert(Array.isArray(myMusic));
```
-`myMusic` 应该至少包含两个元素
+`myMusic`应该有至少2个元素。
```js
assert(myMusic.length > 1);
```
-`myMusic[1]` 应该是一个对象
+`myMusic`元素数组中应该是物体
```js
-assert(typeof myMusic[1] === 'object');
+myMusic.forEach(object => {assert.typeOf(object, 'object')})
```
-`myMusic[1]` 至少要包含四个属性
+`myMusic` 中的对象应该至少有 4 个属性。
```js
-assert(Object.keys(myMusic[1]).length > 3);
+myMusic.forEach(object => {assert(Object.keys(object).length > 3); });
```
-`myMusic[1]` 应该包含一个类型为字符串的 `artist` 的属性
+`myMusic` 中的对象应该包含一个类型为字符串的属性 `artist`。
```js
-assert(
- myMusic[1].hasOwnProperty('artist') && typeof myMusic[1].artist === 'string'
-);
+myMusic.forEach(object => {
+ assert.containsAllKeys(object, ['artist']);
+ assert.typeOf(object.artist, 'string')
+})
```
-`myMusic[1]` 应该包含一个类型为字符串的 `title` 属性
+`myMusic` 中的对象应该包含一个类型为字符串的属性 `title`。
```js
-assert(
- myMusic[1].hasOwnProperty('title') && typeof myMusic[1].title === 'string'
-);
+myMusic.forEach(object => {
+ assert.containsAllKeys(object, ['title']);
+ assert.typeOf(object.title, 'string')
+})
```
-`myMusic[1]` 应该包含一个类型为数字的 `release_year` 属性
+`myMusic` 中的对象应该包含一个类型为数字的属性 `release_year`。
```js
-assert(
- myMusic[1].hasOwnProperty('release_year') &&
- typeof myMusic[1].release_year === 'number'
-);
+myMusic.forEach(object => {
+ assert.containsAllKeys(object, ['release_year']);
+ assert.typeOf(object.release_year, 'number')
+})
```
-`myMusic[1]` 应该包含一个类型为数组的 `formats` 属性
+`myMusic` 中的对象应该包含一个类型为数组的 `formats` 属性。
```js
-assert(
- myMusic[1].hasOwnProperty('formats') && Array.isArray(myMusic[1].formats)
-);
+myMusic.forEach(object => {
+ assert.containsAllKeys(object, ['formats']);
+ assert.typeOf(object.formats, 'array')
+})
```
`formats`应该是一个至少包含两个字符串元素的数组
```js
-assert(
- myMusic[1].formats.every(function (item) {
- return typeof item === 'string';
- }) && myMusic[1].formats.length > 1
-);
+myMusic.forEach(object => {
+ object.formats.forEach(format => {
+ assert.typeOf(format, 'string')
+ });
+ assert.isAtLeast(object.formats.length, 2)
+})
```
# --seed--
@@ -143,7 +147,6 @@ var myMusic = [
],
"gold": true
}
- // Add a record here
];
```
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/modify-array-data-with-indexes.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/modify-array-data-with-indexes.md
index 09d6487dd2..190d68cc8c 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/modify-array-data-with-indexes.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/modify-array-data-with-indexes.md
@@ -20,11 +20,11 @@ ourArray[0] = 15;
`ourArray` 值为 `[15, 40, 30]`。
-**注意:**数组名与方括号之间不应该有任何空格,比如`array [0]` 。 尽管 JavaScript 能够正确处理这种情况,但是当其他程序员阅读你写的代码时,这可能让他们感到困惑。
+**注意:** 数组名与方括号之间不应该有任何空格,比如 `array [0]` 。 尽管 JavaScript 能够正确处理这种情况,但是当其他程序员阅读你写的代码时,这可能让他们感到困惑。
# --instructions--
-将数组 `myArray`中索引为 `0`上的值修改为 `45`。
+将数组 `myArray` 中索引为 `0` 上的值修改为 `45`。
# --hints--
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/multiply-two-numbers-with-javascript.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/multiply-two-numbers-with-javascript.md
index f0ccb4107a..458a8b9294 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/multiply-two-numbers-with-javascript.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/multiply-two-numbers-with-javascript.md
@@ -23,7 +23,7 @@ myVar = 13 * 13;
# --instructions--
-改变数值 `0`来让变量 product 的值等于`80`。
+改变数值 `0` 来让变量 product 的值等于`80`。
# --hints--
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/passing-values-to-functions-with-arguments.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/passing-values-to-functions-with-arguments.md
index 0648e72247..b056ff9fbb 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/passing-values-to-functions-with-arguments.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/passing-values-to-functions-with-arguments.md
@@ -9,7 +9,7 @@ dashedName: passing-values-to-functions-with-arguments
# --description--
-函数的参数 (parameters)在函数中充当调用函数时传入函数的输入占位符(也叫形参)的作用。 函数调用时,参数可以为一个或多个。 调用函数时输入(或传递 "passed")的实际值被称为参数(arguments)。
+函数的参数 (parameters)在函数调用中充当传入函数的输入占位符(也叫形参)。 函数调用时,参数可以为一个或多个。 调用函数时输入(或传递 "passed")的实际值被称为参数(arguments)。
这是带有两个参数的函数,`param1` 和 `param2`:
@@ -19,7 +19,7 @@ function testFun(param1, param2) {
}
```
-然后我们可以调用 `testFun`,就像这样: `testFun("Hello", "World");`。 我们传入了两个字符串参数, `Hello` 和`World`。 在函数中,`param1` 等于字符串 `Hello` 和 `param2` 等于字符串 `World`。 请注意,`testFun` 函数可以多次调用,每次调用时传递的参数会决定参数的实际值。
+然后我们可以调用 `testFun`,就像这样: `testFun("Hello", "World");`。 我们传入了两个字符串参数, `Hello` 和`World`。 在函数中,`param1` 等于字符串 `Hello` 以及 `param2` 等于字符串 `World`。 请注意,`testFun` 函数可以多次调用,每次调用时传递的参数会决定参数的实际值。
# --instructions--
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/quoting-strings-with-single-quotes.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/quoting-strings-with-single-quotes.md
index 5d1e6088aa..8d70d9c8bd 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/quoting-strings-with-single-quotes.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/quoting-strings-with-single-quotes.md
@@ -33,7 +33,7 @@ badStr = 'Finn responds, "Let's go!"';
在上面的 goodStr 中,通过使用反斜杠 `\` 转义字符可以安全地使用两种引号。
-**提示:**不要混淆反斜杠 `\` 和斜杠 `/`。 它们不是一回事。
+**提示:** 不要混淆反斜杠 `\` 和斜杠 `/`。 它们不是一回事。
# --instructions--
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/record-collection.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/record-collection.md
index 964baea8de..f532446f39 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/record-collection.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/record-collection.md
@@ -8,21 +8,21 @@ dashedName: record-collection
# --description--
-给定一个 JSON 对象,用来表示部分音乐专辑收藏。 每张专辑都有几个属性和一个唯一的 id 号作为键值。 并非所有专辑都有完整的信息。
+给定一个对象,用来表示部分音乐专辑收藏。 每张专辑都有几个属性和一个唯一的 id 号作为键值。 并非所有专辑都有完整的信息。
-以 `updateRecords` 函数开使,这个函数需要一个对象如 `collection`,一个 `id`,一个 `prop` (如 `artist` 或 `tracks`), 和 `value`。 使用下面的规则完成函数来修改传递给函数的对象。
+以 `updateRecords` 函数开始,这个函数需要一个对象 `records`,包含一个音乐专辑集合,一个 `id`,一个 `prop`(如 `artist` 或 `tracks`),和一个 `value`。 使用下面的规则完成函数来修改传递给函数的对象。
-- 你的函数必须始终返回整个对象。
+- 函数必须始终返回整个音乐专辑集合对象。
- 如果 `prop` 不是 `tracks` 并且 `value` 不是一个空字符串, 将相册的 `prop` 更新或设置为 `value`。
- 如果 `prop` 是 `tracks` 但专辑没有 `tracks` 属性,则应创建空数组并为其添加 `value`。
- 如果 `prop` 是 `tracks` 并且 `value` 不是一个空字符串,将 `value` 添加到相册现有 `tracks` 数组的末尾。
- 如果 `value` 是空字符串,从专辑里删除指定的 `prop`。
-**注意:** 用 `collection` 对象做为测试参数对象。
+**注意:** 用 `recordCollection` 对象做为测试参数对象。
# --hints--
-执行 `updateRecords(collection, 5439, "artist", "ABBA")` 后, `artist` 应该是字符串 `ABBA`
+执行 `updateRecords(recordCollection, 5439, "artist", "ABBA")` 后,`artist` 的值应该是字符串 `ABBA`。
```js
assert(
@@ -31,7 +31,7 @@ assert(
);
```
-执行 `updateRecords(collection, 5439, "tracks", "Take a Chance on Me")` 后,`tracks` 的最后一个元素应该为字符串 `Take a Chance on Me`。
+执行 `updateRecords(recordCollection, 5439, "tracks", "Take a Chance on Me")` 后,`tracks` 的最后一个元素应该为字符串 `Take a Chance on Me`。
```js
assert(
@@ -41,14 +41,14 @@ assert(
);
```
-执行 `updateRecords(collection, 2548, "artist", "")` 后, `artist` 不应被设置
+执行 `updateRecords(recordCollection, 2548, "artist", "")` 后, `artist` 不应被设置为任何值。
```js
updateRecords(_recordCollection, 2548, 'artist', '');
assert(!_recordCollection[2548].hasOwnProperty('artist'));
```
-执行 `updateRecords(collection, 1245, "tracks", "Addicted to Love")` 后,`tracks` 的最后一个元素应该为字符串 `Addicted to Love`。
+执行 `updateRecords(recordCollection, 1245, "tracks", "Addicted to Love")` 后,`tracks` 的最后一个元素应该为字符串 `Addicted to Love`。
```js
assert(
@@ -58,7 +58,7 @@ assert(
);
```
-执行 `updateRecords(collection, 2468, "tracks", "Free")` 后,`tracks` 的第一个元素应该为字符串 `1999`。
+执行 `updateRecords(recordCollection, 2468, "tracks", "Free")` 后,`tracks` 的第一个元素应该为字符串 `1999`。
```js
assert(
@@ -68,14 +68,14 @@ assert(
);
```
-执行 `updateRecords(collection, 2548, "tracks", "")` 后, `tracks` 不应被设置
+执行 `updateRecords(recordCollection, 2548, "tracks", "")` 后, `tracks` 不应被设置为任何值。
```js
updateRecords(_recordCollection, 2548, 'tracks', '');
assert(!_recordCollection[2548].hasOwnProperty('tracks'));
```
-执行 `updateRecords(collection, 1245, "albumTitle", "Riptide")` 后, `albumTitle` 应该是字符串 `Riptide`
+执行 `updateRecords(recordCollection, 1245, "albumTitle", "Riptide")` 后,`albumTitle` 的值应该是字符串 `Riptide`。
```js
assert(
@@ -115,7 +115,7 @@ const _recordCollection = {
```js
// Setup
-var collection = {
+var recordCollection = {
2548: {
albumTitle: 'Slippery When Wet',
artist: 'Bon Jovi',
@@ -136,17 +136,17 @@ var collection = {
};
// Only change code below this line
-function updateRecords(object, id, prop, value) {
- return object;
+function updateRecords(records, id, prop, value) {
+ return records;
}
-updateRecords(collection, 5439, 'artist', 'ABBA');
+updateRecords(recordCollection, 5439, 'artist', 'ABBA');
```
# --solutions--
```js
-var collection = {
+var recordCollection = {
2548: {
albumTitle: 'Slippery When Wet',
artist: 'Bon Jovi',
@@ -167,15 +167,15 @@ var collection = {
};
// Only change code below this line
-function updateRecords(object, id, prop, value) {
- if (value === '') delete object[id][prop];
+function updateRecords(records, id, prop, value) {
+ if (value === '') delete records[id][prop];
else if (prop === 'tracks') {
- object[id][prop] = object[id][prop] || [];
- object[id][prop].push(value);
+ records[id][prop] = records[id][prop] || [];
+ records[id][prop].push(value);
} else {
- object[id][prop] = value;
+ records[id][prop] = value;
}
- return object;
+ return records;
}
```
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-first-character-in-a-string.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-first-character-in-a-string.md
index fd7af9cb36..470e2c59e1 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-first-character-in-a-string.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-first-character-in-a-string.md
@@ -11,7 +11,7 @@ dashedName: use-bracket-notation-to-find-the-first-character-in-a-string
方括号表示法(Bracket notation)是一种在字符串中的特定 index(索引)处获取字符的方法。
-大多数现代编程语言,如JavaScript,不同于人类从 1 开始计数。 它们是从 0 开始计数。 这被称为基于零(Zero-based)的索引。
+大多数现代编程语言,如 JavaScript,不同于人类从 1 开始计数。 它们是从 0 开始计数。 这被称为基于零(Zero-based)的索引。
例如,单词 `Charles` 的索引 0 的字符是 `C`。 所以在 `var firstName = "Charles"` 中,你可以使用 `firstName[0]` 来获得第一个位置上的字符。
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/write-reusable-javascript-with-functions.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/write-reusable-javascript-with-functions.md
index a63815e6e1..e75a6c112e 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/write-reusable-javascript-with-functions.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/write-reusable-javascript-with-functions.md
@@ -23,7 +23,14 @@ function functionName() {
# --instructions--
-- 先创建一个名为
reusableFunction
的函数,这个函数可以打印 "Hi World"
到控制台上。 - 然后调用这个函数。
+
+ -
+ 先创建一个名为
reusableFunction
的函数,这个函数打印 Hi World
到控制台上。
+
+ -
+ 然后调用这个函数。
+
+
# --hints--
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/telephone-number-validator.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/telephone-number-validator.md
index b3f2306938..d985be3e2a 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/telephone-number-validator.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/telephone-number-validator.md
@@ -180,6 +180,12 @@ assert(telephoneCheck('(555-555-5555') === false);
assert(telephoneCheck('(555)5(55?)-5555') === false);
```
+`telephoneCheck("55 55-55-555-5")` 应返回 `false`。
+
+```js
+assert(telephoneCheck('55 55-55-555-5') === false);
+```
+
# --seed--
## --seed-contents--
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.md
index ceca43f2e7..d9f433d5b7 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.md
@@ -21,7 +21,7 @@ dashedName: remove-whitespace-from-start-and-end
`result` 应该等于 `Hello, World!`
```js
-assert(result == 'Hello, World!');
+assert(result === 'Hello, World!');
```
你不应该使用 `String.prototype.trim()` 方法。
@@ -30,10 +30,10 @@ assert(result == 'Hello, World!');
assert(!code.match(/\.?[\s\S]*?trim/));
```
-`result` 变量不应该设置为等于字符串。
+`result` 变量的值不应该是一个字符串。
```js
-assert(!code.match(/result\s*=\s*".*?"/));
+assert(!code.match(/result\s*=\s*["'`].*?["'`]/));
```
# --seed--