Skip to content

Commit 1bdb2c0

Browse files
committed
関数のviewsource追加
1 parent 5da31d5 commit 1bdb2c0

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-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>max関数 解答例</title>
6+
</head>
7+
<body>
8+
<script src="./script.js"></script>
9+
</body>
10+
</html>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
function max(a, b) {
2+
if (a > b) {
3+
return a;
4+
}
5+
return b;
6+
}
7+
8+
document.write(`${4}${7}のうち大きいのは${max(4, 7)}です。`);

docs/1-trial-session/09-functions/index.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ function max(a, b) {
202202
}
203203
```
204204

205+
<ViewSource url={import.meta.url} path="_samples/max-no-else" />
206+
205207
<Sandpack
206208
template="static"
207209
files={{

0 commit comments

Comments
 (0)