Oops, try again. Did you create a variable called a_to_m?


#1

crew = {
captain: "Picard",
first_officer: "Riker",
lt_cdr: "Data",
lt: "Worf",
ensign: "Ro",
counselor: "Troi",
chief_engineer: "LaForge",
doctor: "Crusher"
}

Add your code below!

first_half = lambda { |k,v| v <"M"}
a_to_m = crew.select (&first_half)
WHAT'S WRONG?


#2

If we use ( ) to pass arguments to a method in Ruby, there can't be a space between the method name (in this case select) and (. It can get quite confusing when we're switching between passing a block to the select method using { } and then passing procs and lambdas directly as arguments using ( ).

If you do crew.select(&first_half) instead of crew.select (&first_half) that will clear the error up and you can move on.


#3

really helpful.. thx (it means a lot):smiley:


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.