mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-07-17 13:43:23 +09:00
Merge pull request #1 from seoul2045/reduce-method
Update calculator.js
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user