Learn JavaScript
Advanced Array Methods
31.8
Lesson

filter()

The filter() method checks all elements of an array on a given condition. The elements that pass the condition are returned in a new array.