From ae7c89a3c6a189db7b0a6ede574919dbd22353b1 Mon Sep 17 00:00:00 2001 From: Rei Akiyama Date: Wed, 13 Mar 2024 06:11:53 +0000 Subject: [PATCH] =?UTF-8?q?=E9=9A=8E=E4=B9=97=E9=96=A2=E6=95=B0=E3=81=AE?= =?UTF-8?q?=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app.js b/app.js index ab9c9ba8..a196c0e7 100644 --- a/app.js +++ b/app.js @@ -7,6 +7,9 @@ */ function factorial(n) { let result = 1; + for(let i=1; i<=n; i++) { + result = result*i; + } // TODO このコメントを消して正しく実装してください。 return result; }