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

This commit is contained in:
camperbot
2022-10-18 08:29:49 +01:00
committed by GitHub
parent e22f87a085
commit 41bbc30b94
6193 changed files with 34024 additions and 29301 deletions

View File

@@ -37,12 +37,6 @@ assert(code.match(/quotient/g).length === 1);
# --seed--
## --after-user-code--
```js
(function(y){return 'quotient = '+y;})(quotient);
```
## --seed-contents--
```js

View File

@@ -11,12 +11,12 @@ dashedName: escape-sequences-in-strings
引号不是字符串中唯一可以被转义(<dfn>escaped</dfn>)的字符。 使用转义字符有两个原因:
1. 首先是可以让你使用无法输入的字符,例如退格。
1. To allow you to use characters you may not otherwise be able to type out, such as a newline.
2. 其次是可以让你在一个字符串中表示多个引号,而不会出错。
我们在之前的挑战中学到了这个。
<table class='table table-striped'><thead><tr><th>代码</th><th>输出</th></tr></thead><tbody><tr><td><code>\'</code></td><td>单引号</td></tr><tr><td><code>\"</code></td><td>双引号</td></tr><tr><td><code>\\</code></td><td>反斜杠</td></tr><tr><td><code>\n</code></td><td>换行符</td></tr><tr><td><code>\r</code></td><td>回车符</td></tr><tr><td><code>\t</code></td><td>制表符</td></tr><tr><td><code>\b</code></td><td>退格</td></tr><tr><td><code>\f</code></td><td>换页符</td></tr></tbody></table>
<table class='table table-striped'><thead><tr><th>代码</th><th>输出</th></tr></thead><tbody><tr><td><code>\'</code></td><td>单引号</td></tr><tr><td><code>\"</code></td><td>双引号</td></tr><tr><td><code>\\</code></td><td>反斜杠</td></tr><tr><td><code>\n</code></td><td>换行符</td></tr><tr><td><code>\t</code></td><td>tab</td></tr><tr><td><code>\r</code></td><td>carriage return</td></tr><tr><td><code>\b</code></td><td>退格</td></tr><tr><td><code>\f</code></td><td>换页符</td></tr></tbody></table>
*请注意,必须对反斜杠本身进行转义,它才能显示为反斜杠。*
@@ -78,14 +78,6 @@ assert(myStr === 'FirstLine\n\t\\SecondLine\nThirdLine');
# --seed--
## --after-user-code--
```js
(function(){
if (myStr !== undefined){
console.log('myStr:\n' + myStr);}})();
```
## --seed-contents--
```js

View File

@@ -31,12 +31,6 @@ assert(/var\s+a\s*=\s*9(\s*;?\s*)$/.test(code));
# --seed--
## --after-user-code--
```js
if(typeof a !== 'undefined') {(function(a){return "a = " + a;})(a);} else { (function() {return 'a is undefined';})(); }
```
## --seed-contents--
```js

View File

@@ -62,12 +62,6 @@ assert(code.match(/"/g).length === 4 && code.match(/'/g).length === 2);
# --seed--
## --after-user-code--
```js
(function() { return "myStr = " + myStr; })();
```
## --seed-contents--
```js

View File

@@ -98,7 +98,7 @@ function nextInLine(arr, item) {
}
// Setup
const testArr = [1, 2, 3, 4, 5];
let testArr = [1, 2, 3, 4, 5];
// Display code
console.log("Before: " + JSON.stringify(testArr));
@@ -109,7 +109,7 @@ console.log("After: " + JSON.stringify(testArr));
# --solutions--
```js
const testArr = [1, 2, 3, 4, 5];
let testArr = [1, 2, 3, 4, 5];
function nextInLine(arr, item) {
arr.push(item);

View File

@@ -71,6 +71,13 @@ assert(
);
```
Global variables should not be used to cache the array.
```js
countdown(1)
assert.deepStrictEqual(countdown(5), [5, 4, 3, 2, 1]);
```
# --seed--
## --seed-contents--

View File

@@ -56,6 +56,13 @@ assert.deepStrictEqual(rangeOfNumbers(6, 9), [6, 7, 8, 9]);
assert.deepStrictEqual(rangeOfNumbers(4, 4), [4]);
```
Global variables should not be used to cache the array.
```js
rangeOfNumbers(1, 3)
assert.deepStrictEqual(rangeOfNumbers(6, 9), [6, 7, 8, 9]);
```
# --seed--
## --seed-contents--