MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/JavaScriptTips/comments/14mizkj/interesting_reduce/jq317j8/?context=3
r/JavaScriptTips • u/France_linux_css • Jun 29 '23
3 comments sorted by
View all comments
4
Nice. A bit of duplicate calculation though.
const grandTotal = totalSum.reduce((total, customer) => { return total + customer.total; }, 0);
4
u/trevedhek Jun 30 '23
Nice. A bit of duplicate calculation though.