mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-23 21:02:28 -05:00
chore(i18n,learn): processed translations (#47032)
This commit is contained in:
@@ -27,24 +27,6 @@ console.log(myBreed);
|
||||
|
||||
コンソールには文字列 `Doberman` が表示されます。
|
||||
|
||||
この用法の別の例として、プログラムの実行中にプロパティの名前を動的に取得することができます。次に例を示します。
|
||||
|
||||
```js
|
||||
const someObj = {
|
||||
propName: "John"
|
||||
};
|
||||
|
||||
function propPrefix(str) {
|
||||
const s = "prop";
|
||||
return s + str;
|
||||
}
|
||||
|
||||
const someProp = propPrefix("Name");
|
||||
console.log(someObj[someProp]);
|
||||
```
|
||||
|
||||
`someProp` の値は文字列 `propName` となり、文字列 `John` がコンソールに表示されます。
|
||||
|
||||
変数を使用してプロパティにアクセスする場合、変数名を引用符で*囲まない*ことに注意してください。使用するのは変数の*値*であって、*名前*ではありません。
|
||||
|
||||
# --instructions--
|
||||
@@ -83,7 +65,7 @@ assert(/testObj\s*?\[.*?\]/.test(code));
|
||||
assert(!code.match(/player\s*=\s*"|\'\s*Montana\s*"|\'\s*;/gi));
|
||||
```
|
||||
|
||||
ブラケット記法で、変数`playerNumber` を使用する必要があります。
|
||||
ブラケット記法で、変数 `playerNumber` を使用する必要があります。
|
||||
|
||||
```js
|
||||
assert(/testObj\s*?\[\s*playerNumber\s*\]/.test(code));
|
||||
|
||||
@@ -32,7 +32,13 @@ const ourStr = "I come first. " + "I come second.";
|
||||
|
||||
# --hints--
|
||||
|
||||
`myStr` の値が文字列 `This is the start.` `This is the end.` になる必要があります。
|
||||
`myStr` は、2 つの文字列の間に空白文字を含む必要があります。
|
||||
|
||||
```js
|
||||
assert(/start\. This/.test(myStr));
|
||||
```
|
||||
|
||||
`myStr` は、文字列の値 `This is the start. This is the end.` を持つ必要があります。
|
||||
|
||||
```js
|
||||
assert(myStr === 'This is the start. This is the end.');
|
||||
|
||||
@@ -28,6 +28,12 @@ ourStr += "I come second.";
|
||||
|
||||
# --hints--
|
||||
|
||||
`myStr` は、2 つの文字列の間に空白文字を含む必要があります。
|
||||
|
||||
```js
|
||||
assert(/sentence\. This/.test(myStr));
|
||||
```
|
||||
|
||||
`myStr` の値が文字列値 `This is the first sentence. This is the second sentence.` になる必要があります。
|
||||
|
||||
```js
|
||||
|
||||
@@ -31,34 +31,13 @@ dashedName: counting-cards
|
||||
assert(//
|
||||
(function () {
|
||||
count = 0;
|
||||
cc(2);
|
||||
cc(2);
|
||||
let out = cc(10);
|
||||
const hasSpace = /-?\d+ Bet/.test('' + out);
|
||||
const hasSpace = /-?\d+ (Bet|Hold)/.test('' + out);
|
||||
return hasSpace;
|
||||
})()
|
||||
);
|
||||
```
|
||||
|
||||
カードの並びが 3、2、A、10、K の場合は文字列 `-1 Hold` を返す必要があります。
|
||||
|
||||
```js
|
||||
assert(
|
||||
(function () {
|
||||
count = 0;
|
||||
cc(3);
|
||||
cc(2);
|
||||
cc('A');
|
||||
cc(10);
|
||||
var out = cc('K');
|
||||
if (out === '-1 Hold') {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
})()
|
||||
);
|
||||
```
|
||||
|
||||
カードの並びが 2、3、4、5、6 の場合は文字列 `5 Bet` を返す必要があります。
|
||||
|
||||
```js
|
||||
|
||||
@@ -25,14 +25,14 @@ const alpha = {
|
||||
26:"A"
|
||||
};
|
||||
|
||||
alpha[2];
|
||||
alpha[24];
|
||||
const thirdLetter = alpha[2];
|
||||
const lastLetter = alpha[24];
|
||||
|
||||
const value = 2;
|
||||
alpha[value];
|
||||
const valueLookup = alpha[value];
|
||||
```
|
||||
|
||||
`alpha[2]` は文字列 `Y`、`alpha[24]` は文字列 `C`、`alpha[value]` は文字列 `Y` となります。
|
||||
`thirdLetter` は文字列 `Y`、`lastLetter` は文字列 `C`、`valueLookup` は文字列 `Y` となります。
|
||||
|
||||
# --instructions--
|
||||
|
||||
|
||||
Reference in New Issue
Block a user