featured

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() : executes a reducer function (that you provide) on each element of the array, resulting in single output value.

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