We have an array of numbers
and
we want to get only the even
numbers from that array:
This code works but array
has select
to handle this
in a better way.
select
will only pick
items for which the result
of the given condition is true
.
Let's see it in action.
As we can see, the code
is much cleaner compared
to the previous one.