Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Array Iteration Methods Combining Array Methods Combining filter() and reduce()

Sorry guys but in the video Combining filter() and reduce() I actually have more questions than answers.

I don't understand how the reduce method has worked in this video. Layman terms please if someone has time. Thank you in advance.

Mahmoud Talass
Mahmoud Talass
9,274 Points

same, I find the reduce method very confusing. I hate it

1 Answer

Came here to say the same! I took a break from this section yesterday bc it was becoming a lot. Today I was understanding the first few concepts, then arrived here and I am completely lost.

I suppose what I understand the least, is how in the example, it new to compare the "highest" value. Same with the sum. If these are variables we are supplying, then how do they know what to do? I understand comparison operators are involved ('>', '+'), I guess I am just missing the link between how they are working here!