From the course: Mastering Web Developer Interview Code

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

How do you search using functional programming?

How do you search using functional programming?

From the course: Mastering Web Developer Interview Code

How do you search using functional programming?

- [Instructor] Now searching through a series of elements can be accomplished in different ways. In the last few episodes, I have been showing you how you can work with higher order functions to perform actions on the items without modifying array. Now, this is actually a style of programming called functional programming. And one of the other functions that we can use to work with this is called the filter functions. Let's take a look at how that work, because it lets us solve a pretty common task. So I'm assuming you have some data that looks like this and we want to filter through this data and retrieve only the records that match a certain element. Now, that type of manipulation is called exclusion because we're removing elements that we want to filter out of a list. So let's take a look at how we might do that with traditional four loops. Here's what we would probably do. We would create a variable to hold the thing…

Contents