The filter Function
Learn the higher-order function abstraction filter for filtering out elements of a list based on a given predicate.
We'll cover the following
Another crucial function abstraction is filter
. We can use it to filter out the elements of a list based on a given condition.
The filter
function on lists
Let’s write a function evens
that returns only even numbers from an integer list.
Get hands-on with 1200+ tech skills courses.