-
-
Save stephen-lazaro/3be56738a2634c045fcf4921947725b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Single aggregate, summing the balances of records | |
const getSumOfBalance = report => | |
// Run over the records | |
report.reduce( | |
// Adding the balance of each record to the total | |
function (sum, record) { | |
return sum + record.balance; | |
}, | |
// Starting at 0 | |
0 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment