Skip to content

Commit 175ee76

Browse files
authored
Update calculator-solution.js
1 parent 80f7881 commit 175ee76

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

08_calculator/solution/calculator-solution.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ const sum = function (array) {
1111
};
1212

1313
const multiply = function(...args){
14-
let sum = 1
15-
for (let i = 0; i < args.length; i++) {
16-
sum *= args[i]
17-
}
18-
return sum
19-
}
14+
let product = 1;
15+
for (let i = 0; i < args.length; i++) {
16+
product *= args[i];
17+
}
18+
return product;
19+
};
2020

2121
const power = function (a, b) {
2222
return Math.pow(a, b);

0 commit comments

Comments
 (0)