Check out a free preview of the full JavaScript: From Fundamentals to Functional JS, v2 course:
The ".filter() Application Exercise" Lesson is part of the full, JavaScript: From Fundamentals to Functional JS, v2 course featured in this preview video. Here's what you'd learn in this lesson:

In this challenge, students use the newly created filter function and loop through a dataset to display only the desired data.

Get Unlimited Access Now

Transcript from the ".filter() Application Exercise" Lesson

[00:00:00]
>> So now we're going to take our filter and we're going to apply it to our data. Remember we have our data here, it scrolls, so just copy and paste from the top. Put it into your text editor or whatever you're using, and then you're going to use your filter to filter this data.

[00:00:22] You wanna see who is present. That night. Hint, there's a flag here, a flag is just a property that says true or false. There's a flag here that says if the suspect was present at the mansion. So, let's use filter and return an array of these objects. Containing only people that were present.