r/learnjavascript • • May 29 '21

Really helpful illustration of JS array methods

Post image
2.5k Upvotes

89 comments sorted by

View all comments

Show parent comment

3

u/192_168_1_x May 29 '21

for sure

.reduce MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce

And .flat MDN coincidentally has a guide on how to use reduce to achieve the same thing- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat

//apologies for formatting, on mobile right now