Skip to content

Instantly share code, notes, and snippets.

@afontcu
Last active September 29, 2017 11:30
Show Gist options
  • Save afontcu/cd1d9ec00df6f65a53a0916eb200d631 to your computer and use it in GitHub Desktop.
Save afontcu/cd1d9ec00df6f65a53a0916eb200d631 to your computer and use it in GitHub Desktop.
list
.filter((element, index, array) => element.amount > 10)
.map((element, index, array) => element.time / 60)
.reduce((accumulator, currentValue, currentIndex, array) => accumulator + currentValue)
// el mateix sense paràmetres inútils:
list
.filter(element => element.amount > 10)
.map(element => element.time / 60)
.reduce((accumulator, currentValue) => accumulator + currentValue)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment