Merge pull request #1 from seoul2045/reduce-method

Update calculator.js
This commit is contained in:
seoul2045 2019-05-16 10:05:59 +07:00 committed by GitHub
commit e93caf6368
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) {
return array.reduce((current, total) => total + current, 0);
return array.reduce((total, current) => total + current, 0);
}
function multiply(array) {