Rails 3. How to get the difference between two arrays? March 24, 2023 by Tarik a = [2, 4, 6, 8] b = [1, 2, 3, 4] a - b | b - a # => [6, 8, 1, 3]