-
-
Save stephen-lazaro/076e77351b60fe3ec53151166adfb42c 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
// Sum the balances _object by object_ | |
const sumBalances = (prior, record) => | |
prior + record.balance; | |
// Sum all the balances one by one by using our object by object definition | |
const getSumOfBalance = report => | |
report.reduce(sumBalances, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment