From 44e39f0412e4ad24001340e8da1848b0c18a66d5 Mon Sep 17 00:00:00 2001 From: Will <59489624+cats256@users.noreply.github.com> Date: Sun, 16 Jul 2023 16:06:25 -0500 Subject: [PATCH] Update calculator-solution.js --- 08_calculator/solution/calculator-solution.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/08_calculator/solution/calculator-solution.js b/08_calculator/solution/calculator-solution.js index 43af44f..b195387 100644 --- a/08_calculator/solution/calculator-solution.js +++ b/08_calculator/solution/calculator-solution.js @@ -6,12 +6,12 @@ const subtract = function (a, b) { return a - b; }; -const sum = function (...args) { - return args.reduce((sum, curr) => sum + curr, 0); +const sum = function (array) { + return array.reduce((total, current) => total + current, 0); }; -const multiply = function(...args){ - return args.reduce((product, curr) => product * curr) +const multiply = function (array) { + return array.reduce((product, current) => product * current) }; const power = function (a, b) {