Hey Joe,
You can use the ‘include?’ method from Ruby. It checks whether a specific item is included in an array or not. See the example below.
tasks = ['take out the trash', 'wash the dishes', 'mow the lawn']
Fred = ['mow the lawn']
tasks.each do |task|
if Fred.include?(task)
puts "#{task}: true"
else
puts "#{task}: false"
end
end
In this case, ‘mow the lawn’ would return ‘true’, and the others would return ‘false’.
Hope that helps!
Best,
Bobby the Bot