mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-09 21:01:20 -04:00
chore(i18n,learn): processed translations (#49694)
This commit is contained in:
@@ -11,13 +11,13 @@ dashedName: assignment-with-a-returned-value
|
||||
|
||||
<a href="/japanese/learn/javascript-algorithms-and-data-structures/basic-javascript/storing-values-with-the-assignment-operator" target="_blank" rel="noopener noreferrer nofollow">「代入演算子を使用して値を格納する」</a>で説明したように、等号の右側の部分はすべて、値が代入される前に解決されます。 つまり、関数の戻り値を受け取って変数に代入することができます。
|
||||
|
||||
Assume we have defined a function `sum` which adds two numbers together.
|
||||
2 つの数値を足し算する関数 `sum` が定義されているとします。
|
||||
|
||||
```js
|
||||
ourSum = sum(5, 12);
|
||||
```
|
||||
|
||||
Calling the `sum` function with the arguments of `5` and `12` produces a return value of `17`. This return value is assigned to the `ourSum` variable.
|
||||
`sum` 関数を `5` と `12` の引数で呼び出すと、`17` の戻り値が返されます。 この戻り値は `ourSum` 変数に代入されます。
|
||||
|
||||
# --instructions--
|
||||
|
||||
|
||||
@@ -9,15 +9,15 @@ dashedName: escape-sequences-in-strings
|
||||
|
||||
# --description--
|
||||
|
||||
文字列の中で<dfn>エスケープ</dfn>できる文字は引用符だけではありません。 Escape sequences allow you to use characters you may not otherwise be able to use in a string.
|
||||
文字列の中で<dfn>エスケープ</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>単語境界</td></tr><tr><td><code>\f</code></td><td>改ページ</td></tr></tbody></table>
|
||||
|
||||
*Note that the backslash itself must be escaped in order to display as a backslash.*
|
||||
*バックスラッシュ自体をバックスラッシュとして表示するためにはエスケープする必要があります。*
|
||||
|
||||
# --instructions--
|
||||
|
||||
Assign the following three lines of text into the single variable `myStr` using escape sequences.
|
||||
エスケープシーケンスを使用して、単一の変数 `myStr` に次の 3 行のテキストを代入してください。
|
||||
|
||||
<pre>
|
||||
FirstLine
|
||||
@@ -25,19 +25,19 @@ FirstLine
|
||||
ThirdLine
|
||||
</pre>
|
||||
|
||||
You will need to use escape sequences to insert special characters correctly. You will also need to follow the spacing as it looks above, with no spaces between escape sequences or words.
|
||||
特殊文字を正しく挿入するにはエスケープシーケンスを使用する必要があります。 また、エスケープシーケンスや単語の間にスペースを入れず、上記のとおりに表示する必要があります。
|
||||
|
||||
**Note:** The indentation for `SecondLine` is achieved with the tab escape character, not spaces.
|
||||
**注:** `SecondLine` にインデントを付けるには、スペースではなくタブエスケープ文字を使用します。
|
||||
|
||||
# --hints--
|
||||
|
||||
`myStr` should not contain any spaces
|
||||
`myStr` にスペースを含めてはいけません
|
||||
|
||||
```js
|
||||
assert(!/ /.test(myStr));
|
||||
```
|
||||
|
||||
`myStr` should contain the strings `FirstLine`, `SecondLine` and `ThirdLine` (remember case sensitivity)
|
||||
`myStr` には文字列 `FirstLine`、`SecondLine`、および `ThirdLine` を含める必要があります (大文字小文字を正しく区別してください)
|
||||
|
||||
```js
|
||||
assert(
|
||||
@@ -45,31 +45,31 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
`FirstLine` should be followed by the newline character `\n`
|
||||
`FirstLine` の直後に改行文字 `\n` を付ける必要があります
|
||||
|
||||
```js
|
||||
assert(/FirstLine\n/.test(myStr));
|
||||
```
|
||||
|
||||
`myStr` should contain a tab character `\t` which follows a newline character
|
||||
`myStr` には改行文字に続けてタブ文字 `\t` を含める必要があります
|
||||
|
||||
```js
|
||||
assert(/\n\t/.test(myStr));
|
||||
```
|
||||
|
||||
`SecondLine` should be preceded by the backslash character `\`
|
||||
`SecondLine` の前にバックスラッシュ文字 `\` を付ける必要があります
|
||||
|
||||
```js
|
||||
assert(/\\SecondLine/.test(myStr));
|
||||
```
|
||||
|
||||
There should be a newline character between `SecondLine` and `ThirdLine`
|
||||
`SecondLine` と `ThirdLine` の間に改行文字を入れる必要があります
|
||||
|
||||
```js
|
||||
assert(/SecondLine\nThirdLine/.test(myStr));
|
||||
```
|
||||
|
||||
`myStr` should only contain characters shown in the instructions
|
||||
`myStr` には指示された文字だけを含める必要があります
|
||||
|
||||
```js
|
||||
assert(myStr === 'FirstLine\n\t\\SecondLine\nThirdLine');
|
||||
|
||||
@@ -15,13 +15,13 @@ dashedName: finding-a-remainder-in-javascript
|
||||
|
||||
<pre>
|
||||
5 % 2 = 1
|
||||
5 / 2 = 2 remainder 1
|
||||
5 / 2 = 2 余り1
|
||||
2 * 2 = 4
|
||||
5 - 4 = 1
|
||||
</pre>
|
||||
|
||||
**Usage**
|
||||
In mathematics, a number can be checked to be even or odd by checking the remainder of the division of the number by `2`. Even numbers have a remainder of `0`, while odd numbers a remainder of `1`.
|
||||
**使用例**
|
||||
数学では、ある数が偶数か奇数かを求めるために、その数を `2` で割った余りを調べることができます。 偶数は `0` の余りを持ち、奇数は `1` の余りを持ちます。
|
||||
|
||||
<pre>
|
||||
17 % 2 = 1
|
||||
|
||||
@@ -60,43 +60,43 @@ assert(!/if/g.test(code));
|
||||
assert(code.match(/break/g).length >= 4);
|
||||
```
|
||||
|
||||
`chainToSwitch("bob")` should return the string `Marley`
|
||||
`chainToSwitch("bob")` は文字列 `Marley` を返す必要があります。
|
||||
|
||||
```js
|
||||
assert(chainToSwitch('bob') === 'Marley');
|
||||
```
|
||||
|
||||
`chainToSwitch(42)` should return the string `The Answer`
|
||||
`chainToSwitch(42)` は文字列 `The Answer` を返す必要があります。
|
||||
|
||||
```js
|
||||
assert(chainToSwitch(42) === 'The Answer');
|
||||
```
|
||||
|
||||
`chainToSwitch(1)` should return the string `There is no #1`
|
||||
`chainToSwitch(1)` は文字列 `There is no #1` を返す必要があります。
|
||||
|
||||
```js
|
||||
assert(chainToSwitch(1) === 'There is no #1');
|
||||
```
|
||||
|
||||
`chainToSwitch(99)` should return the string `Missed me by this much!`
|
||||
`chainToSwitch(99)` は文字列 `Missed me by this much!` を返す必要があります。
|
||||
|
||||
```js
|
||||
assert(chainToSwitch(99) === 'Missed me by this much!');
|
||||
```
|
||||
|
||||
`chainToSwitch(7)` should return the string `Ate Nine`
|
||||
`chainToSwitch(7)` は文字列 `Ate Nine` を返す必要があります。
|
||||
|
||||
```js
|
||||
assert(chainToSwitch(7) === 'Ate Nine');
|
||||
```
|
||||
|
||||
`chainToSwitch("John")` should return `""` (empty string)
|
||||
`chainToSwitch("John")` は `""` (空文字列) を返す必要があります。
|
||||
|
||||
```js
|
||||
assert(chainToSwitch('John') === '');
|
||||
```
|
||||
|
||||
`chainToSwitch(156)` should return `""` (empty string)
|
||||
`chainToSwitch(156)` は `""` (空文字列) を返す必要があります。
|
||||
|
||||
```js
|
||||
assert(chainToSwitch(156) === '');
|
||||
|
||||
Reference in New Issue
Block a user