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:
seoul2045 2019-05-16 09:49:12 +07:00 committed by GitHub
parent 01aace24b1
commit 645cbc746f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) {