I would like to compare two arrays and return the first value of array 1 that matches an item from array two. Here is what I have so far:
def find_the_color(array_1)
array_2 = ["red", "yellow", "blue"]
sample.find do |x|
x=="red"||x=="yellow"||x=="blue"
end
end
I would like to do this using the array instead of separating it into 3 conditional statements. Is there a way?