Does Ruby have a method that I could use when I have 2 arrays (lists) and I want to get an array (list) of only the values common to both arrays? Like this..
a = [1,2,3] b = [3,4,5] => the method would return [3]
Conversely, values that are “unique” in these arrays (lists).
a = [1,2,3] b = [3,4,5] => the method would return [1,2,4,5]
source share