In this article, we are exploring the Array.filter() method; a very commonly used and helpful method. It takes an array of elements and returns a new array with only those elements that meet whatever condition we supply it with. In the example above, we used the filter() to filter out everything that isn’t a pizza and keep just the pizza.

7m read timeFrom cult.honeypot.io
Post cover image
Table of contents
Array filter()In the real worldHow does it work?What’s moreWhat it looked like prior to ES6What it looks like in a for loopSummary

Sort: