15 Now You try! help


#1

I can't get past this, here's my code. It keeps giving me the error "oops did you define a lambda called symbol_filter?" Appreciate any help

my_array = ["raindrops", :kettles, "whiskers", :mittens, :packages]

Add your code below!

symbol_filter = lambda {|x| x.is_a?Symbol}
symbols = my_array.select (&symbol_filter) one. .


#2

Not sure about the trailing text... one. .. That can be removed.


#3

Can't say for sure, but white space in a call expression raises a flag, for me.

symbols = my_array.select(&symbol_filter)

#4

thanks, that's a pasting error,


#5

you are right! I ended up tweaking it and it worked. thank you

my_array = ["raindrops", :kettles, "whiskers", :mittens, :packages]

Add your code below!

symbol_filter = lambda {|my_array| my_array.is_a?Symbol}
symbols = my_array.select(&symbol_filter)


#6

Here is my answer:
my_array = ["raindrops", :kettles, "whiskers", :mittens, :packages]

Add your code below!

symbol_filter = lambda { |symbol| symbol.is_a? Symbol }
symbols = my_array.select(&symbol_filter)

I don't believe we should be using "my_array" inside the lambda, as it is already the name of the array.
Am I correct?