Is there a way to compare two arrays and show what is common to both of them?
array1 = ["pig", "dog", "cat"] array2 = ["dog", "cat", "pig", "horse"]
What should I print to show that ["pig", "dog", "cat"] are common between these two arrays?
ruby
miles Aug 20 '10 at 17:09 2010-08-20 17:09
source share