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\", \"hor
You can intersect the arrays using &:
&
array1 & array2
This will return ["pig", "dog", "cat"].
["pig", "dog", "cat"]