Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <cfscript>
- payments = [
- [{amt: 1}, {amt: 1}, {amt: 1}],
- [{amt: 1}, {amt: 1}],
- [{amt: 1}]
- ];
- function sumInvoiceAmounts(require array invoices) {
- return invoices.reduce(function (subtotal, invoice) {
- return subtotal + invoice.amt;
- }, 0);
- }
- function sumPaymentInvoices(required array payments) {
- return payments.reduce(function (total, invoices) {
- //var fml =
- return total + sumInvoiceAmounts(invoices);
- }, 0);
- }
- writeDump(sumPaymentInvoices(payments))
- </cfscript>
Add Comment
Please, Sign In to add comment