Update calculator.js
This commit is contained in:
parent
7b03e764bb
commit
5156aa6611
1 changed files with 1 additions and 1 deletions
|
@ -10,7 +10,7 @@ function sum(array) {
|
|||
return array.reduce((current, total) => total + current, 0);
|
||||
}
|
||||
|
||||
function multiply (array) {
|
||||
function multiply(array) {
|
||||
return array.length
|
||||
? array.reduce((accumulator, nextItem) => accumulator * nextItem): 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue