Guest User

Untitled

a guest
Jun 17th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. <cfscript>
  2. payments = [
  3. [{amt: 1}, {amt: 1}, {amt: 1}],
  4. [{amt: 1}, {amt: 1}],
  5. [{amt: 1}]
  6. ];
  7. function sumPaymentAmounts(required array payments) {
  8. return payments.reduce(function (total, invoices) {
  9. /*
  10. return total += arrayreduce(invoices, function (subtotal, invoice) {
  11. return subtotal += invoice.amt;
  12. }, 0);
  13. */
  14. try {
  15. writedump([arguments.total, arguments.invoices]);
  16. } catch (any e) {
  17. writedump(e);
  18. }
  19. return total;
  20. }, 0);
  21. }
  22. writeDump(sumPaymentAmounts(payments))
  23. </cfscript>
Add Comment
Please, Sign In to add comment