Created
June 24, 2020 06:14
-
-
Save abrarShariar/18b131f7bf21eb6d89e67abe7d232f72 to your computer and use it in GitHub Desktop.
solution
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
const totalNumberOfPurchase = purchases.reduce((allTotal, product) => { | |
const sum = product.records.reduce((total, record) => { | |
return total + record.purchase_num; | |
}, 0); | |
return allTotal + sum; | |
}, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment