From f6d3775bf0e8a3f982a8ba7e2f6223925fdc5d9b Mon Sep 17 00:00:00 2001 From: Jared Ramon Elizan Date: Sat, 13 Aug 2022 12:59:25 +0800 Subject: [PATCH] added initial answers --- 08_calculator/calculator.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/08_calculator/calculator.js b/08_calculator/calculator.js index c22e8d2..996c821 100644 --- a/08_calculator/calculator.js +++ b/08_calculator/calculator.js @@ -1,25 +1,25 @@ -const add = function() { - +const add = function(a, b) { + return a + b; }; -const subtract = function() { - +const subtract = function(a, b) { + return a - b; }; -const sum = function() { - +const sum = function(a, b) { + return a + b }; -const multiply = function() { - +const multiply = function(a, b) { + return a * b; }; -const power = function() { - +const power = function(a, b) { + return Math.pow(a, b); }; -const factorial = function() { - +const factorial = function(a, b) { + return a / b; }; // Do not edit below this line