From 637cbf62601a7ae8dfe5b0b6b0552c0134f96a14 Mon Sep 17 00:00:00 2001 From: yeongjun Kim Date: Sat, 25 Mar 2023 07:56:10 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9E=90=EB=A6=BF=EC=88=98=20=EB=8D=94?= =?UTF-8?q?=ED=95=98=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Programmers/exam35.js | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Programmers/exam35.js diff --git a/Programmers/exam35.js b/Programmers/exam35.js new file mode 100644 index 0000000..548572e --- /dev/null +++ b/Programmers/exam35.js @@ -0,0 +1,6 @@ +function solution(n) { + return n + .toString() + .split("") + .reduce((a, c) => a + Number(c), 0); +}