An array of sets to compute the union of.
A new set that is the union of all sets in the input array.
This function does not mutate the original sets.
T - The type of elements in the sets.
const set1 = new Set([1, 2, 3]);
const set2 = new Set([2, 3, 4]);
const set3 = new Set([3, 4, 5]);
setUnion([set1, set2, set3]);
//=> Set(5) { 1, 2, 3, 4, 5 }
Generated using TypeDoc
Computes the union of multiple sets.