From bc8573a185f90a0c70f7eabf206ef7c29b1ce3f4 Mon Sep 17 00:00:00 2001 From: Fridge0 Date: Sat, 7 Oct 2023 15:27:12 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=83=96=E3=83=AD?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=81=AE=E5=A4=96=E5=81=B4=E3=81=AB=E7=A7=BB?= =?UTF-8?q?=E5=8B=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/1-trial-session/09-functions/index.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/1-trial-session/09-functions/index.md b/docs/1-trial-session/09-functions/index.md index 785619bc1..fd690f709 100644 --- a/docs/1-trial-session/09-functions/index.md +++ b/docs/1-trial-session/09-functions/index.md @@ -124,8 +124,9 @@ increment(); 複雑な操作を 関数 として モジュール化 して複数のブロックに分解することで、コードの可読性を上げることができます。 +モジュール化前: + ```javascript -// モジュール化前 const stringToRepeat = "☆"; for (let i = 0; i < 10; i += 1) { let result = ""; @@ -137,8 +138,9 @@ for (let i = 0; i < 10; i += 1) { } ``` +モジュール化後: + ```javascript -// モジュール化後 function repeat(stringToRepeat, times) { let result = ""; for (let j = 0; j < times; j += 1) {