Skip to content

Instantly share code, notes, and snippets.

@isacjunior
Last active August 29, 2017 21:47
Show Gist options
  • Save isacjunior/a6d8ac4b3a4109801a797d4efbfd0856 to your computer and use it in GitHub Desktop.
Save isacjunior/a6d8ac4b3a4109801a797d4efbfd0856 to your computer and use it in GitHub Desktop.
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