Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
8,500 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!