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.
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 loopSummarySort: