---
title: "init(forUnionSet:with:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsexpression/init(forunionset:with:)"
---

# init(forUnionSet:with:)

Creates an expression object that represents the union of a specified set and collection.

## Declaration

```swift
init(forUnionSet left: NSExpression, with right: NSExpression)
```

## Parameters

- `left`: An expression that evaluates to an NSSet object.
- `right`: An expression that evaluates to a collection object (an instance of NSArray, NSSet, or NSDictionary).

## Return Value

Return Value An new NSExpression object that represents the union of left and right.

## See Also

### Creating a Collection Expression

- [init(forAggregate:)](foundation/nsexpression/init(foraggregate:).md)
- [init(forIntersectSet:with:)](foundation/nsexpression/init(forintersectset:with:).md)
- [init(forMinusSet:with:)](foundation/nsexpression/init(forminusset:with:).md)
