Returns a new set with the elements of both this set and the given sequence.
SDK
- Xcode 10.2+
Framework
- Swift Standard Library
Declaration
Parameters
other
A sequence of elements.
other
must be finite.
Return Value
A new set with the unique elements of this set and other
.
Discussion
In the following example, the attendees
set is made up of the elements of the attendees
set and the visitors
array:
If the set already contains one or more elements that are also in other
, the existing members are kept. If other
contains multiple instances of equivalent elements, only the first instance is kept.