Learn
Perfect! Now let’s pass our proc to a method.
Instructions
1.
Now we’ll be using the ages
array. Create a variable called youngsters
and set it equal to calling .select
on ages
, and pass in your under_100
proc to filter for the ages that are less than one hundred. Remember to pass &under_100
to convert your proc to a block!
puts
youngsters
at the end of the file in order to see the final contents of the array.
Take this course for free
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.