r/JavaScriptTips • • Jun 29 '23

interesting reduce

Post image
21 Upvotes

3 comments sorted by

4

u/trevedhek Jun 30 '23

Nice. A bit of duplicate calculation though.

const grandTotal = totalSum.reduce((total, customer) => {
   return total + customer.total;
}, 0);

2

u/[deleted] Jun 30 '23

That's so cool using different concepts to produce a single output

1

u/Shoko1910 Jun 30 '23

What is the name of the theme ?