8000 Update calculator-solution.js · gitwinst/javascript-exercises@44e39f0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 44e39f0

Browse files
authored
Update calculator-solution.js
1 parent 1dae9df commit 44e39f0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

08_calculator/solution/calculator-solution.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ const subtract = function (a, b) {
66
return a - b;
77
};
88

9-
const sum = function (...args) {
10-
return args.reduce((sum, curr) => sum + curr, 0);
9+
const sum = function (array) {
10+
return array.reduce((total, current) => total + current, 0);
1111
};
1212

13-
const multiply = function(...args){
14-
return args.reduce((product, curr) => product * curr)
13+
const multiply = function (array) {
14+
return array.reduce((product, current) => product * current)
1515
};
1616

1717
const power = function (a, b) {

0 commit comments

Comments
 (0)
0