Created
July 5, 2011 17:56
-
-
Save jaredfolkins/1065421 to your computer and use it in GitHub Desktop.
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
A few examples will help to clarify these operations. Let's begin by creating two arrays: | |
operating_systems = ["Fedora", "SuSE", "RHEL", "Windows", "MacOS"] | |
linux_systems = ["RHEL", "SuSE", "PCLinuxOS", "Ubuntu", "Fedora"] | |
Now, we can create a union of the two arrays: | |
operating_systems | linux_systems | |
=> ["Fedora", "SuSE", "RHEL", "Windows", "MacOS", "PCLinuxOS", "Ubuntu"] | |
As we can see from the above output, the union operation joined one array to another, but removed any duplicate array elements. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment