Created
November 7, 2020 16:10
-
-
Save bunnyhawk/8d1e804e056289ea17ad6cee9d9d322b 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
arr.reduce((accumulator, currentValue, currentIndex, sourceArray) => { | |
// accumulator: the current running "total" | |
// currentValue: the current value of the arr (we are looping through them, one by one) | |
// currentIndex: where you are in the loop (0 based, as usual) | |
// sourceArray: access to the unmodified original arr array | |
// Return a function here leveraging the accumulator or currentValue | |
}, initialValue); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment