Created
March 19, 2020 19:00
-
-
Save lexruee/43d7d618107af7d61f8ee42f4e2c9b32 to your computer and use it in GitHub Desktop.
Compare two arrays and return a new array with any items only found in one of the two given arrays, but not both.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def diff_array(first_array, second_array) | |
(first_array - second_array) + (second_array - first_array) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment