Update calculator.js
This commit is contained in:
parent
5156aa6611
commit
3182c2c22d
|
@ -12,7 +12,8 @@ function sum(array) {
|
||||||
|
|
||||||
function multiply(array) {
|
function multiply(array) {
|
||||||
return array.length
|
return array.length
|
||||||
? array.reduce((accumulator, nextItem) => accumulator * nextItem): 0;
|
? array.reduce((accumulator, nextItem) => accumulator * nextItem
|
||||||
|
: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function power(a, b) {
|
function power(a, b) {
|
||||||
|
|
Loading…
Reference in New Issue