Update calculator.js
The reduce() method syntax for callbacks assigns the accumulator value followed by the currentValue, so I think the above variables should be switched.
This commit is contained in:
parent
01aace24b1
commit
645cbc746f
1 changed files with 1 additions and 1 deletions
|
@ -7,7 +7,7 @@ function subtract(a, b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function sum(array) {
|
function sum(array) {
|
||||||
return array.reduce((current, total) => total + current, 0);
|
return array.reduce((total, current) => total + current, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
function multiply(array) {
|
function multiply(array) {
|
||||||
|
|
Loading…
Reference in a new issue