0
What is the reduce() method in Javascript used for?
How is it different from map() method and filter() method?
3 Respostas
+ 5
Reduce the most advanced of all these methods.. its usage can be so versatile, in simple view .. it "reduces" the arrays it's applied on to *a single value* this value can be a number, a string or.. another array
I suggest you go to the MDN documentation covering its usage .. and try to practice it more (you won't fully get it, till you use it) via challenges on edabit for example
+ 3
https://css-tricks.com/an-illustrated-and-musical-guide-to-map-reduce-and-filter-array-methods/
Don't forget to click the "snowball" link there.