From a3c7a49770d46bca9e90d8606c2dba717c2cbcae Mon Sep 17 00:00:00 2001 From: "jason.zhu" Date: Wed, 12 May 2021 12:11:47 +1000 Subject: [PATCH] Module2: Demo add 2 numbers --- app.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/app.js b/app.js index 6788a32..25add5f 100644 --- a/app.js +++ b/app.js @@ -1,12 +1,4 @@ -function setupCounter(val) { - return function counter() { - return val++; - } -} +let sum2 = (num1, num2) => num1 + num2; -let counter1 = setupCounter(0); -console.log(counter1()); -console.log(counter1()); -let counter2 = setupCounter(10); -console.log(counter2()); -console.log(counter2()); \ No newline at end of file +let output = sum2(10,5); +console.log(output); \ No newline at end of file