Skip to main content

ExperimentalSetMethods<T>

Type Parameters

Type Parameter
T

Polyfill

difference()

difference(other)

difference<U>(other): Set<Exclude<T, U>>

Takes a set and returns a new set containing elements in this set but not in the given set.

Type Parameters
Type Parameter
U extends string | number
Parameters
ParameterType
otherSetLike<U>
Returns

Set<Exclude<T, U>>

difference(other)

difference<U>(other): Set<T>
Type Parameters
Type Parameter
U
Parameters
ParameterType
otherSetLike<U>
Returns

Set<T>


intersection()

intersection<U>(other): Set<T & U>

Returns a new set containing the elements that are present in both this set and the other set.

Type Parameters

Type Parameter
U

Parameters

ParameterType
otherSetLike<U>

Returns

Set<T & U>


symmetricDifference()

symmetricDifference<U>(other): Set<T | U>

Takes a set and returns a new set containing elements which are in either this set or the given set, but not in both.

Type Parameters

Type Parameter
U

Parameters

ParameterType
otherSetLike<U>

Returns

Set<T | U>


union()

union<U>(other): Set<T | U>

Returns a new set containing elements which are in either or both of this set and the given set.

Type Parameters

Type Parameter
U

Parameters

ParameterType
otherSetLike<U>

Returns

Set<T | U>