Update calculator-solution.js
This commit is contained in:
parent
80f7881a26
commit
175ee761e1
1 changed files with 6 additions and 6 deletions
|
@ -11,12 +11,12 @@ const sum = function (array) {
|
|||
};
|
||||
|
||||
const multiply = function(...args){
|
||||
let sum = 1
|
||||
for (let i = 0; i < args.length; i++) {
|
||||
sum *= args[i]
|
||||
}
|
||||
return sum
|
||||
}
|
||||
let product = 1;
|
||||
for (let i = 0; i < args.length; i++) {
|
||||
product *= args[i];
|
||||
}
|
||||
return product;
|
||||
};
|
||||
|
||||
const power = function (a, b) {
|
||||
return Math.pow(a, b);
|
||||
|
|
Loading…
Reference in a new issue