Creates a sink collecting the distinct items of the feed into a set.
Items are made immutable as they are collected, in first-appearance order, and compared with SameValueZero
semantics, so NaN matches itself and -0 matches 0.
The returned set is frozen, with add, delete and clear shadowed by own properties that throw: entries cannot
be altered through the set, although mutating methods invoked directly on Set.prototype still reach the internal
slots backing them.
Warning
Accumulates the whole feed in memory. For large or infinite feeds, this may exhaust memory or never complete.
Warning
Freezing clones structured items, giving them a fresh identity: entries are not reachable through the original
item reference, and the same mutable item collected twice yields two distinct entries rather than being
deduplicated. Supply structured items as immutable values to keep their identity stable.
Creates a sink collecting the distinct items of the feed into a set.
Items are made immutable as they are collected, in first-appearance order, and compared with
SameValueZerosemantics, soNaNmatches itself and-0matches0.The returned set is frozen, with
add,deleteandclearshadowed by own properties that throw: entries cannot be altered through the set, although mutating methods invoked directly onSet.prototypestill reach the internal slots backing them.Accumulates the whole feed in memory. For large or infinite feeds, this may exhaust memory or never complete.
Freezing clones structured items, giving them a fresh identity: entries are not reachable through the original item reference, and the same mutable item collected twice yields two distinct entries rather than being deduplicated. Supply structured items as immutable values to keep their identity stable.