Skip to content

Commit 5da31d5

Browse files
committed
変数の章のviewsourceを追加
1 parent 5d581e2 commit 5da31d5

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!doctype html>
2+
<html lang="ja">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Title</title>
6+
</head>
7+
<body>
8+
<script src="./script.js"></script>
9+
</body>
10+
</html>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
let price = 100;
2+
price = price / 2;
3+
document.write(price);

docs/1-trial-session/06-variables/index.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ price = price / 2;
9090
document.write(price);
9191
```
9292

93+
<ViewSource url={import.meta.url} path="_samples/compound-assignment" />
94+
9395
{/* prettier-ignore */}
9496
<Term>代入</Term><Term>演算子</Term>は、まず右辺の<Term>式</Term>を<Term>評価</Term>します。これにより、右辺は`100 / 2`となります。よって、最終的に<Term>変数</Term>`price`の<Term>値</Term>は`50`となり、これは`price`を半分にする操作に対応します。
9597

0 commit comments

Comments
 (0)