Skip to content

Instantly share code, notes, and snippets.

@afontcu
Created September 29, 2017 11:35
Show Gist options
  • Save afontcu/4196744077cf40b18f8ffff3b25e0466 to your computer and use it in GitHub Desktop.
Save afontcu/4196744077cf40b18f8ffff3b25e0466 to your computer and use it in GitHub Desktop.
const moreThanTen = (element, index, array) => element.amount > 10
const minutesToHours = (element, index, array) => element.time / 60
const sumValues = (accumulator, currentValue, currentIndex, array) => accumulator + currentValue
list
.filter(moreThanTen)
.map(minutesToHours)
.reduce(sumValues)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment