Last active
September 29, 2017 11:30
-
-
Save afontcu/cd1d9ec00df6f65a53a0916eb200d631 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
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