diff --git a/docs/1-trial-session/09-functions/_samples/max-no-else/index.html b/docs/1-trial-session/09-functions/_samples/max-no-else/index.html deleted file mode 100644 index ca212b868..000000000 --- a/docs/1-trial-session/09-functions/_samples/max-no-else/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - max関数 解答例 - - - - - diff --git a/docs/1-trial-session/09-functions/_samples/max-no-else/script.js b/docs/1-trial-session/09-functions/_samples/max-no-else/script.js deleted file mode 100644 index 7327845bb..000000000 --- a/docs/1-trial-session/09-functions/_samples/max-no-else/script.js +++ /dev/null @@ -1,8 +0,0 @@ -function max(a, b) { - if (a > b) { - return a; - } - return b; -} - -document.write(`${4}と${7}のうち大きいのは${max(4, 7)}です。`); diff --git a/docs/1-trial-session/09-functions/index.mdx b/docs/1-trial-session/09-functions/index.mdx index ede6bbe7a..cebaefb5d 100644 --- a/docs/1-trial-session/09-functions/index.mdx +++ b/docs/1-trial-session/09-functions/index.mdx @@ -189,23 +189,6 @@ function max(a, b) { -:::note - -`a > b`が`true`の場合、if文内部の`return`で関数実行が中断されるため、`else`キーワードは必ずしも必要ではありません。そのため、次のように書くこともできます。 - -```javascript -function max(a, b) { - if (a > b) { - return a; - } - return b; -} -``` - - - -::: - ## 演習問題2(発展)