Skip to content

Commit 0501f6b

Browse files
authored
++演算子消去
1 parent 81be338 commit 0501f6b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ i = i + 1;
8383
i += 1;
8484
```
8585

86+
<!-- 教えるかどうか議論
8687
[**インクリメント演算子**](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Operators/Increment) は、与えられた変数に1を足します。
8788
一方、[**デクリメント演算子**](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Operators/Decrement) は、与えられた変数から1を引きます。
8889
@@ -99,8 +100,11 @@ i = i + 1;
99100
i++;
100101
```
101102
103+
-->
104+
102105
:::
103106

107+
104108
## for 文
105109

106110
`for` 文は、`while` 文にほんの少しだけ機能を追加したものになります。
@@ -151,8 +155,8 @@ document.write(sum);
151155
`for` 文や `while` 文は、ネストして使用することができます。次のプログラムは、`(x, y) = (0, 0)` から始まって `(x, y) = (4, 4)` まで画面に表示します。
152156

153157
```javascript
154-
for (let x = 0; x < 5; x++) {
155-
for (let y = 0; y < 5; y++) {
158+
for (let x = 0; x < 5; x += 1) {
159+
for (let y = 0; y < 5; y += 1) {
156160
document.write(`(x, y) = (${x}, ${y})<br>`);
157161
}
158162
}

0 commit comments

Comments
 (0)