- Continue to practice using
yield
and blocks. - Gain a deeper understanding of the common enumerable
.select
.
Now that we've built our own .each
and .collect
methods, let's build our own .select
method! If you don't remember what .select
does, review the Ruby docs on it.
Write your code in lib/my_select.rb
. Get the tests to pass.
A few things to think about:
- What is the return value of yielding a character to a block?
- How can you ensure your
.select
method can respond appropriately to being passed an argument of an empty collection?