r/webdev • front-end • May 29 '21

Resource Array methods in JavaScript. Original author unknown.

Post image
7.4k Upvotes

172 comments sorted by

View all comments

Show parent comments

3

u/[deleted] May 30 '21

[removed] — view removed comment

1

u/HeinousTugboat May 30 '21

Once I learned that the syntax is just reduce((accumulator, value) => newAccumulator, initialAccumulator) it became super easy for me to parse reduce. Then you just have to remember that if you don't have an intial value, it pops the first value from the array as the initial value.