Update calculator-solution.js

This commit is contained in:
Will 2023-07-16 16:06:25 -05:00 committed by GitHub
parent 1dae9df3ce
commit 44e39f0412
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -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) {