Last active
August 29, 2017 21:47
-
-
Save isacjunior/a6d8ac4b3a4109801a797d4efbfd0856 to your computer and use it in GitHub Desktop.
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 sumSales = (previusSales, nextSales) => previusSales + nextSales | |
const bySales = (item) => item.sales | |
const totalSales = users.map(bySales).reduce(sumSales) | |
console.log(totalSales) // 49991 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment