mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-06 06:01:31 -05:00
chore(i18n,learn): processed translations (#50061)
This commit is contained in:
@@ -11,7 +11,7 @@ dashedName: comparisons-with-the-logical-and-operator
|
||||
|
||||
有时你需要在一次判断中做多个操作。 当且仅当<dfn>运算符</dfn>的左边和右边都是 true,<dfn>逻辑与</dfn>运算符(`&&`)才会返回 `true`。
|
||||
|
||||
The same effect could be achieved by nesting an `if` statement inside another `if`.
|
||||
可以通过在一个 `if` 语句中嵌套另一个 `if` 语句来实现同样的效果。
|
||||
|
||||
```js
|
||||
if (num > 5) {
|
||||
@@ -22,7 +22,7 @@ if (num > 5) {
|
||||
return "No";
|
||||
```
|
||||
|
||||
This code will return `Yes` if `num` is greater than `5` and less than `10`. The same logic can be written with the <dfn>logical and</dfn> operator.
|
||||
当 `num` 的值大于 `5` 并且小于`10`,代码会返回 `Yes`。 可以使用<dfn>逻辑 and</dfn> 操作符写出相同的逻辑。
|
||||
|
||||
```js
|
||||
if (num > 5 && num < 10) {
|
||||
|
||||
@@ -13,7 +13,7 @@ dashedName: comparisons-with-the-logical-or-operator
|
||||
|
||||
<dfn>逻辑或</dfn>运算符由两个竖线(`||`)组成。 这个按键位于退格键和回车键之间。
|
||||
|
||||
The pattern below should look familiar from prior waypoints.
|
||||
下面这个模式看起来应该很熟悉:
|
||||
|
||||
```js
|
||||
if (num > 10) {
|
||||
@@ -25,7 +25,7 @@ if (num < 5) {
|
||||
return "Yes";
|
||||
```
|
||||
|
||||
This code will return `Yes` if `num` is between `5` and `10` (`5` and `10` included). The same logic can be written with the <dfn>logical or</dfn> operator.
|
||||
如果 `num` 在 `5` 和 `10` 之间(包括 `5` 和 `10`),这段代码将返回 `Yes`。 可以使用<dfn>逻辑 or</dfn> 操作符写出同样的逻辑。
|
||||
|
||||
```js
|
||||
if (num > 10 || num < 5) {
|
||||
|
||||
@@ -11,7 +11,7 @@ dashedName: escape-sequences-in-strings
|
||||
|
||||
引号不是字符串中唯一可以被转义(<dfn>escaped</dfn>)的字符。 转义字符允许你使用可能无法在字符串中使用的字符。
|
||||
|
||||
<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>制表符</td></tr><tr><td><code>\r</code></td><td>回车</td></tr><tr><td><code>\b</code></td><td>backspace</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>制表符</td></tr><tr><td><code>\r</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>
|
||||
|
||||
*请注意,反斜线本身必须被转义,才能显示为反斜线。*
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ dashedName: selecting-from-many-options-with-switch-statements
|
||||
|
||||
# --description--
|
||||
|
||||
If you need to match one value against many options, you can use a <dfn>switch</dfn> statement. A `switch` statement compares the value to the <dfn>case</dfn> statements which define various possible values. Any valid JavaScript statements can be executed inside a <dfn>case</dfn> block and will run from the first matched `case` value until a `break` is encountered.
|
||||
如果你需要将一个值与许多选项匹配,你可以使用 <dfn>switch</dfn> 语句。 `switch` 语句将值与定义各种可能的值的 <dfn>case</dfn> 语句比较。 任何有效的 JavaScript 语句都可以在 <dfn>case</dfn> 块中执行,并且将从第一个匹配的 `case` 的值开始运行,直到遇到 `break`。
|
||||
|
||||
这是 `switch` 语句的示例:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user