Filters … Not Just for Coffee: Part 1 of the Code Fellows “Mastering Arrays” Video Series

Filtering content is the most basic of tasks. We do this constantly (and without thinking) while browsing for movies, scanning search results and even with human conversation. JavaScript’s array .filter() method for arrays makes the task of combing through arrays, even complex ones, very achievable.

Master this superhero of a method and enjoy a new level of readability in your code, while allowing you to help your users to consume large amounts of data in more concise, logical chunks.

What is the JS Array Filter Method?

As per MDN:

Array.prototype.filter() : creates a new array with all elements that pass the test implemented by the provided function.

That means we get to consider each element of an array, to see how it compares in a customized conditional statement.

How do I use it?

Let’s see it in action!

Next PostPrevious Post

About the Author