Loading
Current section: 5. Array Methods 5 exercises
Problem

Reduce

Loading exercise

Transcript

00:00 Alright. Let's talk about reduce. Now, this one is a little bit trickier and you can definitely write reducers that are kinda hard to understand and hard to read. And so for this one, I would actually recommend that you take a second to accomplish the task with four loops and then try to rewrite it as a map filter and then a reducer. There are some situations where you can't actually use map filter, that's why we're gonna be using reduce.

00:30 But, you can definitely do all of these things with four loops. So, you might try a four loop and then compare it to the reduce that, might help you understand what the reduce is doing a little bit better too. So, in my solution, we'll start with a for loop and then we'll get into, how you convert that over to reduce to hopefully help make all of this make more sense. So, with that, let's just jump into it. We'll see you in the exercise step.