Skip to content

Commit 7996280

Browse files
authored
Merge pull request #268 from ut-code/develop
`develop` を `master` にマージ
2 parents 56221e9 + 7a43ec9 commit 7996280

File tree

11 files changed

+30
-30
lines changed

11 files changed

+30
-30
lines changed

docs/1-trial-session/04-expressions/index.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Term from "@site/src/components/Term";
66

77
## <Term type="javascriptValue">値</Term>
88

9-
次のコードを実行すると、`Hello World`が画面に表示されました。
9+
次のコードを実行すると、`Hello World` が画面に表示されました。
1010

1111
```javascript title="script.js"
1212
document.write("Hello World");
@@ -36,7 +36,7 @@ document.write(3 + 4);
3636
document.write(3 + 4 * 5);
3737
```
3838

39-
`*`(乗算<Term type="javascriptOperator">演算子</Term>)は`+`より<Term type="javascriptOperatorPriority">優先順位</Term>が高く設定されているため、上記のコードの実行結果は`23`となります。
39+
`*`(乗算<Term type="javascriptOperator">演算子</Term>)は `+` より<Term type="javascriptOperatorPriority">優先順位</Term>が高く設定されているため、上記のコードの実行結果は `23` となります。
4040

4141
このコードにおいて、`3 + 4 * 5` や、`4 * 5``4` を<Term strong type="javascriptExpression">式</Term>と呼びます。また、<Term type="javascriptExpression">式</Term>が計算され、その結果としての<Term type="javascriptValue">値</Term>が確定することを式が<Term strong type="javascriptEvaluation">評価</Term>されるといいます。
4242

@@ -61,15 +61,15 @@ document.write("Hello" + 1 + 2);
6161

6262
このような場合、<Term type="javascriptOperator">演算子</Term>の**結合規則**を考える必要があります。
6363

64-
`+` の結合規則は左から右なので、`3 + 4 + "Hello"``(3 + 4) + "Hello"` `"Hello" + 1 + 2``("Hello" + 1) + 2`と解釈されることになります。
64+
`+` の結合規則は左から右なので、`3 + 4 + "Hello"``(3 + 4) + "Hello"``"Hello" + 1 + 2``("Hello" + 1) + 2`と解釈されることになります。
6565

66-
`+`は、両辺が<Term type="javascriptNumber">数値</Term>の場合のみ加算<Term type="javascriptOperator">演算子</Term>として振る舞い、片方が<Term type="javascriptNumber">数値</Term>で片方が<Term type="javascriptString">文字列</Term>の場合は<Term type="javascriptNumber">数値</Term>を<Term type="javascriptString">文字列</Term>に変換してから<Term type="javascriptString">文字列</Term>結合<Term type="javascriptOperator">演算子</Term>として機能します。このため、最終的な<Term type="javascriptExpression">式</Term>全体の<Term type="javascriptEvaluation">評価</Term>結果は前者が `"7Hello"` 、後者が `"Hello12"` となるのです。
66+
`+` は、両辺が<Term type="javascriptNumber">数値</Term>の場合のみ加算<Term type="javascriptOperator">演算子</Term>として振る舞い、片方が<Term type="javascriptNumber">数値</Term>で片方が<Term type="javascriptString">文字列</Term>の場合は<Term type="javascriptNumber">数値</Term>を<Term type="javascriptString">文字列</Term>に変換してから<Term type="javascriptString">文字列</Term>結合<Term type="javascriptOperator">演算子</Term>として機能します。このため、最終的な<Term type="javascriptExpression">式</Term>全体の<Term type="javascriptEvaluation">評価</Term>結果は前者が `"7Hello"` 、後者が `"Hello12"` となるのです。
6767

6868
### 代表的な演算子
6969

70-
| 演算子 | 説明 ||
71-
| ------ | -------- | ----------------------------------- |
72-
| `+` |  足す | `1 + 1 === 2 ` `"A" + "B" === "AB"` |
73-
| `-` |  引く | `2 - 1 === 1` |
74-
| `*` |  掛ける | `2 * 2 === 4` |
75-
| `/` |  割る | `4 / 2 === 2` |
70+
| 演算子 | 意味 | |
71+
| ------ | -------- | ------------------------------------- |
72+
| `+` |  足す | `1 + 1``2``"A" + "B"``"AB"` |
73+
| `-` |  引く | `2 - 1``1` |
74+
| `*` |  掛ける | `2 * 2``4` |
75+
| `/` |  割る | `4 / 2``2` |

docs/1-trial-session/07-if-statement/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import ViewSource from "@site/src/components/ViewSource";
77

88
## if 構文
99

10-
**if 構文**は、<Term type="javascript">JavaScript</Term>の<Term strong type="javascriptControlFlow">制御構造</Term>で、特定の条件下のみで実行されるプログラムを記述することができます。
10+
**if 構文**は、<Term type="javascript">JavaScript</Term> の<Term strong type="javascriptControlFlow">制御構造</Term>で、特定の条件下のみで実行されるプログラムを記述することができます。
1111

1212
## 基本構造
1313

@@ -18,7 +18,7 @@ if (age < 20) {
1818
}
1919
```
2020

21-
このプログラムは、 `未成年者の場合は法定代理人の同意が必要です。` と表示しますが、1 行目を `let age = 20;` に変更すると何も表示されなくなります。
21+
このプログラムは、`未成年者の場合は法定代理人の同意が必要です。` と表示しますが、1 行目を `let age = 20;` に変更すると何も表示されなくなります。
2222

2323
2 行目の `if (age < 20) {` 部分がポイントです。ここに差し掛かると、括弧内の<Term type="javascriptExpression">式</Term> `age < 20` が<Term type="javascriptEvaluation">評価</Term>され、`true` になります。このため、直後の波括弧内の処理が実行されます。
2424

docs/1-trial-session/08-functions/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ greet();
2121
greet();
2222
```
2323

24-
上のプログラムにおいて、`function`キーワードから始まる部分は<Term type="javascriptFunction">関数</Term>を定義するための<Term type="javascriptControlFlow">制御構文</Term>です。<Term type="javascriptFunction">関数</Term>定義では、 `function` キーワードに続けて<Term type="javascriptFunction">関数</Term>名、かっこを記述します。この後、<Term type="javascriptFunction">関数</Term>内で実行したい処理を波かっこの中に記述していきます。
24+
上のプログラムにおいて、`function` キーワードから始まる部分は<Term type="javascriptFunction">関数</Term>を定義するための<Term type="javascriptControlFlow">制御構文</Term>です。<Term type="javascriptFunction">関数</Term>定義では、 `function` キーワードに続けて<Term type="javascriptFunction">関数</Term>名、かっこを記述します。この後、<Term type="javascriptFunction">関数</Term>内で実行したい処理を波かっこの中に記述していきます。
2525

2626
<p><Term type="javascriptFunction">関数</Term>を定義すると、<Term type="javascriptFunction">関数</Term>名に続けてかっこを記述することにより、その<Term type="javascriptFunction">関数</Term>を実行できるようになります。</p>
2727

docs/1-trial-session/10-object/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ JavaScript で扱うことのできる<Term type="javascriptValue">値</Term>の
1717

1818
:::tip ほかの言語の経験者へ
1919

20-
JavaScript の<Term type="javascriptObject">オブジェクト</Term>は、ほかの言語でいう**辞書****連想配列****Map**に近いものです。ただ、こういったものと比べ、JavaScript の<Term type="javascriptObject">オブジェクト</Term>は使用頻度が非常に高いです。
20+
JavaScript の<Term type="javascriptObject">オブジェクト</Term>は、ほかの言語でいう**辞書****連想配列****Map** に近いものです。ただ、こういったものと比べ、JavaScript の<Term type="javascriptObject">オブジェクト</Term>は使用頻度が非常に高いです。
2121

2222
:::
2323

@@ -57,7 +57,7 @@ document.write(person.age);
5757

5858
:::tip 複合代入演算子
5959

60-
[複合代入演算子](https://developer.mozilla.org/ja/docs/Web/JavaScript/Guide/Expressions_and_Operators#assignment_operators)は、計算と代入を同時に行うことができる演算子です。
60+
[複合代入演算子](https://developer.mozilla.org/ja/docs/Web/JavaScript/Guide/Expressions_and_Operators#%E4%BB%A3%E5%85%A5%E6%BC%94%E7%AE%97%E5%AD%90)は、計算と代入を同時に行うことができる演算子です。
6161

6262
`x += y` は、`x = x + y` という意味になります。他にも `-=``*=` などの演算子が定義されています。`x -= y``x = x - y``x *= y``x = x * y` という意味になります。
6363

docs/1-trial-session/11-dom/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ element.textContent = "Hello DOM";
2626

2727
![DOM](./dom.png)
2828

29-
`document.getElementById` が<Term type="javascriptReturn">返す</Term><Term type="javascriptObject">オブジェクト</Term>には、取得した HTML<Term type="element">要素</Term>の特徴を表す、たくさんの<Term type="javascriptProperty">プロパティ</Term>が含まれています。下はその一部分です。
29+
`document.getElementById` が<Term type="javascriptReturn">返す</Term><Term type="javascriptObject">オブジェクト</Term>には、取得した HTML <Term type="element">要素</Term>の特徴を表す、たくさんの<Term type="javascriptProperty">プロパティ</Term>が含まれています。下はその一部分です。
3030

3131
| プロパティ | 説明 |
3232
| ------------- | ---------------------------------------------------- |

docs/1-trial-session/12-events/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func();
2424
## <Term type="eventHandler">イベントハンドラ</Term>
2525

2626
<p><Term type="javascriptObject">オブジェクト</Term>の<Term type="javascriptProperty">プロパティ</Term>として<Term type="javascriptFunction">関数</Term>を利用することもできます。 <code>document.getElementById</code> が返す<Term type="javascriptObject">オブジェクト</Term>の <code>onclick</code> <Term type="javascriptProperty">プロパティ</Term>には、<Term type="element">要素</Term>がクリックされたときに実行される<Term type="javascriptFunction">関数</Term>を指定できます。</p>
27-
ボタンのクリック、フォームへの入力、ページの読み込みなど、Webページ上で発生するあらゆるアクションを総称して<Term type="events">イベント</Term>と呼びます。このような<Term type="events">イベント</Term>の処理を行うのが<Term type="eventHandler">イベントハンドラ</Term>で、<code>onclick</code> 関数はその一例です。
27+
ボタンのクリック、フォームへの入力、ページの読み込みなど、Web ページ上で発生するあらゆるアクションを総称して<Term type="events">イベント</Term>と呼びます。このような<Term type="events">イベント</Term>の処理を行うのが<Term type="eventHandler">イベントハンドラ</Term>で、<code>onclick</code> 関数はその一例です。
2828

2929
```html title="index.html"
3030
<button id="greet-button" type="button">クリック</button>

docs/6-exercise/4-css/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ h3 {
450450

451451
### 問題 1
452452

453-
水色の部分(ヘッダー)が、スクロールしても同じ位置にとどまるようにしてみましょう。
453+
「スタイルシート大学 文化祭」と書かれた灰色の部分(ヘッダー)が、スクロールしても同じ位置にとどまるようにしてみましょう。
454454

455455
<video src={headerScrollVideo} controls />
456456

docs/6-exercise/9-fetch-api/_samples/restaurants/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ app.post("/register", (request, response) => {
2222

2323
app.post("/rate", (request, response) => {
2424
const index = request.body.index;
25-
restaurants[index].totalRating += Number(request.body.points); // 文字列を数値に変換
25+
restaurants[index].totalRating += Number(request.body.rating); // 文字列を数値に変換
2626
restaurants[index].numRatings += 1;
2727

2828
if (restaurants[index].numRatings !== 0) {

docs/6-exercise/9-fetch-api/_samples/restaurants/static/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<th>お店を評価</th>
1717
<td>
1818
<select id="name-select"></select>
19-
<select id="points-select">
19+
<select id="rating-select">
2020
<option value="5">☆5</option>
2121
<option value="4">☆4</option>
2222
<option value="3">☆3</option>

docs/6-exercise/9-fetch-api/_samples/restaurants/static/script.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
const restaurantList = document.getElementById("restaurant-list");
22
const nameInput = document.getElementById("name-input");
33
const nameSelect = document.getElementById("name-select");
4-
const pointsSelect = document.getElementById("points-select");
4+
const ratingSelect = document.getElementById("rating-select");
55

66
setInterval(async () => {
7-
// nameSelect にも pointsSelect にもフォーカスが当たっていない際にのみ、要素を再生成する
7+
// nameSelect にも ratingSelect にもフォーカスが当たっていない際にのみ、要素を再生成する
88
if (
99
document.activeElement !== nameSelect &&
10-
document.activeElement !== pointsSelect
10+
document.activeElement !== ratingSelect
1111
) {
1212
const response = await fetch("/restaurants");
1313
const restaurants = await response.json();
@@ -45,10 +45,10 @@ document.getElementById("register-button").onclick = async () => {
4545

4646
document.getElementById("rate-button").onclick = async () => {
4747
const index = nameSelect.value;
48-
const points = pointsSelect.value;
48+
const rating = ratingSelect.value;
4949
await fetch("/rate", {
5050
method: "post",
5151
headers: { "Content-Type": "application/json" },
52-
body: JSON.stringify({ index: index, points: points }),
52+
body: JSON.stringify({ index: index, rating: rating }),
5353
});
5454
};

0 commit comments

Comments
 (0)