Changes

Advanced Ruby Arrays

2 bytes removed, 12:24, 1 December 2007
Intersection, Union and Difference
</table>
A few examples will help to clarify these operations. Lets Let's begin by creating two arrays:
<pre>
</pre>
Now, we can try performing create a union of the two arrays:
<pre>
</pre>
This time, we only get elements that are common to both arrays.
Finally, we can try a "difference" operation:
</pre>
In this case, the new array only contains elements that are not present (ie i.e duplicated) in both arrays.
== Identifying Unique Array Elements ==