File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed
docs/1-trial-session/05-variables Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ <!doctype html>
2+ < html lang ="ja ">
3+ < head >
4+ < meta charset ="utf-8 " />
5+ < title > カウンター</ title >
6+ </ head >
7+ < body >
8+ < script src ="./script.js "> </ script >
9+ </ body >
10+ </ html >
Original file line number Diff line number Diff line change 1+ let counter = 0 ;
2+ document . write ( counter ) ;
3+ counter = counter + 1 ;
4+ document . write ( counter ) ;
Original file line number Diff line number Diff line change @@ -100,3 +100,21 @@ document.write(price);
100100よって、最終的に<Term >変数</Term > ` price ` の<Term >値</Term >は ` 50 ` となり、これは ` price ` を半分にする操作に対応します。
101101
102102![ 変数の再代入] ( ./reassignment-evaluation.png )
103+
104+ ## 確認問題
105+
106+ ` counter ` という名前の変数を作成し初期値を ` 0 ` としてください。
107+ その後、` counter ` に ` 1 ` を加え、その結果を表示してください。
108+
109+ <Answer title = " カウンター" >
110+
111+ ``` javascript title="script.js"
112+ let counter = 0 ;
113+ document .write (counter);
114+ counter = counter + 1 ;
115+ document .write (counter);
116+ ```
117+
118+ <ViewSource url = { import .meta .url } path = " _samples/counter" />
119+
120+ </Answer >
You can’t perform that action at this time.
0 commit comments