Transcript from the "filter, map, & reduce Exercise" Lesson
>> So what we're gonna do in the next exercise is work with these functions. We're going to apply some of them, we're gonna get used to writing the type of functions that they take in and apply to the elements in the array. And we're also going to try our hand at implementing some of them, and understanding the implementations of them.
[00:02:31] That's gonna be part of the brain work you need to do in this exercise. You can see all of the instructions in the exercise, but essentially we're going to go through. There is a filter function that's been implemented for you using some little helper functions, like for example, length a function that you can call on an array, instead of calling array.length.
[00:03:02] Again, this is all just to get us really, really practiced in using this functional style. Getting more used to using a functional kind of API for interacting with data and things, as opposed to the dot method object oriented API that we're more used to perhaps. So in these exercises, you're gonna be filling in some to TODOS.
[00:03:25] You're gonna be finding some predicate functions and some map functions and some reducer functions that will produce the expected output. And in fact, you're gonna be writing your own implementation of map to see how you might do this in a functional way without cheating and using array.map. So challenge yourself see if you can do it without relying on those methods, there are some helper functions defined in here to help you do that.
[00:03:58] The functions are described in there and you can also find the code for them down at the bottom of the page. One quick note about the way observable works is that, the cells do not need to be defined in the order that you want to run them. So you can actually call a function higher up in the page that you define lower down.
[00:04:43] So we're going to be implementing map, we're going to be doing some challenges where we pass in new functions to map. And then we're going to also be working on getting used to writing these reducer functions which take an accumulator and a value, and produce a single value.
[00:05:01] So go ahead at your own pace and go through this exercise. There are some exercises that are marked challenged those are kind of extra if you have the time. So try to get through everything that not before coming back to the challenge ones. And if anybody has any questions, we will definitely be able to dig into those when we review the exercises together.