chore(i18n,learn): processed translations (#45504)

This commit is contained in:
camperbot
2022-03-23 19:52:04 +05:30
committed by GitHub
parent dbb7f309a7
commit 3add6077ad
162 changed files with 2383 additions and 826 deletions

View File

@ -14,18 +14,16 @@ dashedName: comparison-with-the-inequality-operator
**例如**
```js
1 != 2
1 != "1"
1 != '1'
1 != true
0 != false
1 != 2 // true
1 != "1" // false
1 != '1' // false
1 != true // false
0 != false // false
```
按顺序,这些表达式会返回 `true``false``false``false``false`
# --instructions--
`if` 语句中添加不等运算符 `!=` 以便函数在 `val` 不等于 `99` 时返回字符串 `Not Equal`
`if` 语句中添加不等运算符 `!=` 以便函数在 `val` 不等于 `99` 时返回字符串 `Not Equal`
# --hints--
@ -59,7 +57,7 @@ assert(testNotEqual('12') === 'Not Equal');
assert(testNotEqual('bob') === 'Not Equal');
```
你应该使用 `!=` 运算符
你应该使用 `!=` 运算符
```js
assert(code.match(/(?!!==)!=/));

View File

@ -14,58 +14,56 @@ dashedName: comparison-with-the-less-than-operator
**例如:**
```js
2 < 5
'3' < 7
5 < 5
3 < 2
'8' < 4
2 < 5 // true
'3' < 7 // true
5 < 5 // false
3 < 2 // false
'8' < 4 // false
```
按顺序,这些表达式会返回 `true``true``false``false``false`
# --instructions--
添加小于运算符到指定行,使得函数的返回语句有意义。
小于运算符添加到指示的行,以便返回语句有意义。
# --hints--
`testLessThan(0)` 应该返回字符串 `Under 25`
`testLessThan(0)` 应该返回字符串 `Under 25`
```js
assert(testLessThan(0) === 'Under 25');
```
`testLessThan(24)` 应该返回字符串 `Under 25`
`testLessThan(24)` 应该返回字符串 `Under 25`
```js
assert(testLessThan(24) === 'Under 25');
```
`testLessThan(25)` 应该返回字符串 `Under 55`
`testLessThan(25)` 应该返回字符串 `Under 55`
```js
assert(testLessThan(25) === 'Under 55');
```
`testLessThan(54)` 应该返回字符串 `Under 55`
`testLessThan(54)` 应该返回字符串 `Under 55`
```js
assert(testLessThan(54) === 'Under 55');
```
`testLessThan(55)` 应该返回字符串 `55 or Over`
`testLessThan(55)` 应该返回字符串 `55 or Over`
```js
assert(testLessThan(55) === '55 or Over');
```
`testLessThan(99)` 应该返回字符串 `55 or Over`
`testLessThan(99)` 应该返回字符串 `55 or Over`
```js
assert(testLessThan(99) === '55 or Over');
```
应该使用 `<` 运算符至少两次
应该使用 `<` 运算符至少两次
```js
assert(code.match(/val\s*<\s*('|")*\d+('|")*/g).length > 1);

View File

@ -14,18 +14,16 @@ dashedName: comparison-with-the-less-than-or-equal-to-operator
**例如**
```js
4 <= 5
'7' <= 7
5 <= 5
3 <= 2
'8' <= 4
4 <= 5 // true
'7' <= 7 // true
5 <= 5 // true
3 <= 2 // false
'8' <= 4 // false
```
按顺序,这些表达式会返回 `true``true``true``false``false`
# --instructions--
添加小于等于运算符到指定行,使得函数的返回语句有意义。
小于等于运算符添加到指示的行,以便返回语句有意义。
# --hints--

View File

@ -16,17 +16,15 @@ dashedName: comparison-with-the-strict-equality-operator
**示例**
```js
3 === 3
3 === '3'
3 === 3 // true
3 === '3' // false
```
这些条件将分别返回 `true` and `false`
在第二个例子中,`3` 是一个 `Number` 类型,而 `'3'` 是一个 `String` 类型。
# --instructions--
`if` 语句中使用严格相等运算符,这样 `val` 严格等于 `7`,函数将返回字符串 `Equal`
`if` 语句中使用严格相等运算符,这样函数将在 `val` 严格等于 `7` 时返回字符串 `Equal`
# --hints--
@ -48,7 +46,7 @@ assert(testStrict(7) === 'Equal');
assert(testStrict('7') === 'Not Equal');
```
应该使用 `===` 运算符
应该使用 `===` 运算符
```js
assert(code.match(/(val\s*===\s*\d+)|(\d+\s*===\s*val)/g).length > 0);

View File

@ -14,13 +14,11 @@ dashedName: comparison-with-the-strict-inequality-operator
**示例**
```js
3 !== 3
3 !== '3'
4 !== 3
3 !== 3 // false
3 !== '3' // true
4 !== 3 // true
```
按顺序,这些表达式会返回 `false``true``true`
# --instructions--
`if` 语句中,添加严格不相等运算符,这样函数在当 `val` 不严格等于 `17` 的时候,会返回 `Not Equal`
@ -51,7 +49,7 @@ assert(testStrictNotEqual(12) === 'Not Equal');
assert(testStrictNotEqual('bob') === 'Not Equal');
```
应该使用 `!==` 运算符
应该使用 `!==` 运算符
```js
assert(code.match(/(val\s*!==\s*\d+)|(\d+\s*!==\s*val)/g).length > 0);

View File

@ -25,7 +25,7 @@ dashedName: counting-cards
# --hints--
序列 2、3、4、5、6 应返回 `5 Bet`
序列 2、3、4、5、6 应返回字符串 `5 Bet`
```js
assert(

View File

@ -21,32 +21,28 @@ FAV_PET = "Dogs";
你应该始终使用 `const` 关键字命名不想重新分配的变量。 这有助于避免给一个常量进行额外的再次赋值。
命名常量的常见做法是全部使用大写字母,单词之间用下划线分隔
**注意:** 对于不可变值,开发人员通常使用大写变量标识符,对可变值(对象和数组)使用小写或驼峰式标识符。 你将在后面的挑战中了解有关对象、数组以及不可变和可变值的更多信息。 同样在后面的挑战中,你将看到大写、小写或驼峰式变量标识符的示例。
**注意:** 通常,开发者会用大写字母作为常量标识符,用小写字母或者驼峰命名作为变量(对象或数组)标识符。 你将在后面的挑战中了解有关对象、数组以及不可变和可变值的更多信息。 同样在后面的挑战中,你将看到大写、小写或驼峰式变量标识符的示例
# --instructions--
更改代码,以便使用 `let``const` 声明所有变量。 当你希望变量改变时使用 `let`当你希望变量保持不变时使用 `const`。 此外,重命名用 `const` 声明的变量以符合常见做法,这意味着常量应该全部大写
更改代码,以便使用 `let``const` 声明所有变量。 当你想要改变变量时使用 `let`,当你想要变量保持不变时使用 `const`。 此外,重命名使`const` 声明的变量以符合惯例
# --hints--
`var` 不应存在于你的代码中
代码中不应有 `var`
```js
(getUserInput) => assert(!getUserInput('index').match(/var/g));
assert.notMatch(code, /var/g);
```
你应该将 `fCC` 更改为全部大写。
```js
(getUserInput) => {
assert(getUserInput('index').match(/(FCC)/));
assert(!getUserInput('index').match(/fCC/));
}
assert.match(code, /(FCC)/);
assert.notMatch(code, /(fCC)/);
```
`FCC` 应该是一个用 `const` 声明的常量变量
`FCC` 应该是一个用 `const` 声明的常量。
```js
assert.equal(FCC, 'freeCodeCamp');
@ -56,14 +52,13 @@ assert.match(code, /const\s+FCC/);
`fact` 应该用 `let` 声明。
```js
(getUserInput) => assert(getUserInput('index').match(/(let fact)/g));
assert.match(code, /(let\s+fact)/g);
```
`console.log` 应该更改为打印 `FCC``fact` 变量。
```js
(getUserInput) =>
assert(getUserInput('index').match(/console\.log\(\s*FCC\s*\,\s*fact\s*\)\s*;?/g));
assert.match(code, /console\.log\(\s*FCC\s*\,\s*fact\s*\)\s*;?/g);
```
# --seed--

View File

@ -38,9 +38,13 @@ assert(myVar === 10);
应该修改 `myVar = myVar - 1;`
```js
assert(
/let\s*myVar\s*=\s*11;\s*\/*.*\s*([-]{2}\s*myVar|myVar\s*[-]{2});/.test(code)
);
assert(!code.match(/myVar\s*=\s*myVar\s*[-]\s*1.*?;?/));
```
你不应将 `10` 分配给 `myVar`
```js
assert(!code.match(/myVar\s*=\s*10.*?;?/));
```
应该对 `myVar` 使用 `--` 运算符。
@ -49,7 +53,7 @@ assert(
assert(/[-]{2}\s*myVar|myVar\s*[-]{2}/.test(code));
```
不应修改注释上的代码。
不应修改注释上的代码。
```js
assert(/let myVar = 11;/.test(code));

View File

@ -23,7 +23,7 @@ myTest();
console.log(loc);
```
`myTest()` 函数调用将在控制台中显示字符串 `foo``console.log(loc)`会产生一个错误,因为 `loc` 没有定义在函数之外。
`myTest()` 函数调用将在控制台中显示字符串 `foo``console.log(loc)`(在 `myTest` 函数之外)将抛出错误,因为 `loc` 在函数之外定义
# --instructions--

View File

@ -31,13 +31,13 @@ assert(
);
```
执行 `updateRecords(recordCollection, 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(
updateRecords(_recordCollection, 5439, 'tracks', 'Take a Chance on Me')[5439][
'tracks'
].pop() === 'Take a Chance on Me'
updateRecords(_recordCollection, 5439, 'tracks', 'Take a Chance on Me') &&
_recordCollection[5439]['tracks'].length === 1 &&
_recordCollection[5439]['tracks'].pop() === 'Take a Chance on Me'
);
```

View File

@ -9,7 +9,7 @@ dashedName: understanding-uninitialized-variables
# --description--
当 JavaScript 中的变量被声明的时候,程序内部会给它一个初始值 `undefined`。 当你对一个值为 `undefined` 的变量进行运算操作的时候,算出来的结果将会是 `NaN`,它的意思是 <dfn>"Not a Number"</dfn>当你用一个值是 `undefined` 变量来做字符串拼接操作的时候,它会转换成字符串(<dfn>string</dfn>`undefined`
当 JavaScript 中的变量被声明的时候,程序内部会给它一个初始值 `undefined`。 当你对一个值为 `undefined` 的变量进行运算操作的时候,算出来的结果将会是 `NaN`,它的意思是 <dfn>"Not a Number"</dfn>如果你用 `undefined` 变量连接一个字符串,你将得到一个 `undefined`<dfn>字符串</dfn>
# --instructions--

View File

@ -41,7 +41,7 @@ assert(firstLetterOfLastName === 'L');
应该使用方括号表示法。
```js
assert(code.match(/firstLetterOfLastName\s*?=\s*?lastName\[.*?\]/));
assert(code.match(/firstLetterOfLastName\s*=\s*lastName\s*\[\s*\d\s*\]/));
```
# --seed--

View File

@ -39,7 +39,7 @@ assert(thirdLetterOfLastName === 'v');
应该使用方括号表示法。
```js
assert(code.match(/thirdLetterOfLastName\s*?=\s*?lastName\[.*?\]/));
assert(code.match(/thirdLetterOfLastName\s*=\s*lastName\s*\[\s*\d\s*\]/));
```
# --seed--