-
-
Save stephen-lazaro/7fc1e96b1d1c7cf3b3b6e8c85a810fda 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 => { | |
// Declare our goal | |
let sumOfBalance = 0; | |
// Sum each balance into our goal | |
report.forEach(function (record) { | |
sumOfBalance += record.balance; | |
}); | |
// Return the achieved goal | |
return sumOfBalance; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment