chore(i8n,learn): processed translations (#41350)
* chore(i8n,learn): processed translations * fix: restore deleted test * fix: revert casing change Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
This commit is contained in:
committed by
GitHub
parent
8e4ada8f2d
commit
aff0ea700d
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d7b85367417b2b2512b3a
|
||||
title: Catch Arguments Passed in the Wrong Order When Calling a Function
|
||||
title: 调用函数时,捕获以错误顺序传递的参数
|
||||
challengeType: 1
|
||||
forumTopicId: 301184
|
||||
dashedName: catch-arguments-passed-in-the-wrong-order-when-calling-a-function
|
||||
@ -8,21 +8,21 @@ dashedName: catch-arguments-passed-in-the-wrong-order-when-calling-a-function
|
||||
|
||||
# --description--
|
||||
|
||||
Continuing the discussion on calling functions, the next bug to watch out for is when a function's arguments are supplied in the incorrect order. If the arguments are different types, such as a function expecting an array and an integer, this will likely throw a runtime error. If the arguments are the same type (all integers, for example), then the logic of the code won't make sense. Make sure to supply all required arguments, in the proper order to avoid these issues.
|
||||
继续讨论调用函数,需要注意的下一个 bug 是函数的参数传递顺序错误。 如果参数分别是不同的类型,例如接受数组和整数两个参数的函数,参数顺序传错就可能会引发运行时错误。 对于接受相同类型参数的函数,传错参数也会导致逻辑错误或运行结果错误。 确保以正确的顺序提供所有必需的参数以避免这些问题。
|
||||
|
||||
# --instructions--
|
||||
|
||||
The function `raiseToPower` raises a base to an exponent. Unfortunately, it's not called properly - fix the code so the value of `power` is the expected 8.
|
||||
函数 `raiseToPower` 返回基数 (base) 的指数 (exponent) 次幂。 不幸的是,它没有被正确调用 — 修改代码,使`power`的值为 8。
|
||||
|
||||
# --hints--
|
||||
|
||||
Your code should fix the variable `power` so it equals 2 raised to the 3rd power, not 3 raised to the 2nd power.
|
||||
你应修复变量 `power`,使其等于 2 的 3 次方,而不是 3 的 2 次方。
|
||||
|
||||
```js
|
||||
assert(power == 8);
|
||||
```
|
||||
|
||||
Your code should use the correct order of the arguments for the `raiseToPower` function call.
|
||||
你调用 `raiseToPower` 函数时,传递参数的顺序应正确。
|
||||
|
||||
```js
|
||||
assert(code.match(/raiseToPower\(\s*?base\s*?,\s*?exp\s*?\);/g));
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d7b84367417b2b2512b35
|
||||
title: Catch Misspelled Variable and Function Names
|
||||
title: 捕获拼错的变量名和函数名
|
||||
challengeType: 1
|
||||
forumTopicId: 301186
|
||||
dashedName: catch-misspelled-variable-and-function-names
|
||||
@ -8,41 +8,41 @@ dashedName: catch-misspelled-variable-and-function-names
|
||||
|
||||
# --description--
|
||||
|
||||
The `console.log()` and `typeof` methods are the two primary ways to check intermediate values and types of program output. Now it's time to get into the common forms that bugs take. One syntax-level issue that fast typers can commiserate with is the humble spelling error.
|
||||
`console.log()` 和 `typeof` 方法是检查中间值和程序输出类型的两种主要方法。 现在是时候了解一下 bug 出现的常见的情形。 一个语法级别的问题是打字太快带来的低级拼写错误。
|
||||
|
||||
Transposed, missing, or mis-capitalized characters in a variable or function name will have the browser looking for an object that doesn't exist - and complain in the form of a reference error. JavaScript variable and function names are case-sensitive.
|
||||
变量或函数名的错写、漏写或大小写弄混都会让浏览器尝试查找并不存在的东西,并报出“引用错误”。 JavaScript 变量和函数名称区分大小写。
|
||||
|
||||
# --instructions--
|
||||
|
||||
Fix the two spelling errors in the code so the `netWorkingCapital` calculation works.
|
||||
修复代码中的两个拼写错误,以便 `netWorkingCapital` 计算有效。
|
||||
|
||||
# --hints--
|
||||
|
||||
Check the spelling of the two variables used in the netWorkingCapital calculation, the console output should show that "Net working capital is: 2".
|
||||
检查计算 netWorkingCapital 值时使用的两个变量的拼写是否正确,控制台应该输出 "Net working capital is: 2"。
|
||||
|
||||
```js
|
||||
assert(netWorkingCapital === 2);
|
||||
```
|
||||
|
||||
There should be no instances of mis-spelled variables in the code.
|
||||
代码中不应存在拼写错误的变量。
|
||||
|
||||
```js
|
||||
assert(!code.match(/recievables/g));
|
||||
```
|
||||
|
||||
The `receivables` variable should be declared and used properly in the code.
|
||||
应在代码中声明并正确使用 `receivables` 变量。
|
||||
|
||||
```js
|
||||
assert(code.match(/receivables/g).length == 2);
|
||||
```
|
||||
|
||||
There should be no instances of mis-spelled variables in the code.
|
||||
代码中不应存在拼写错误的变量。
|
||||
|
||||
```js
|
||||
assert(!code.match(/payable;/g));
|
||||
```
|
||||
|
||||
The `payables` variable should be declared and used properly in the code.
|
||||
应在代码中声明并正确使用 `payables` 变量。
|
||||
|
||||
```js
|
||||
assert(code.match(/payables/g).length == 2);
|
||||
|
Reference in New Issue
Block a user