Returns an immutable set of the distinct elements of elements, in first-seen order, deciding
sameness by options as a HashSet does: SameValueZero by default, a derived key, or an
equivalence. The whole source is read before any key, equals or hash call, so a callback
that changes the source does not affect the result. Given a set this function or
setOf returned with the same key or equivalence (or none on both), it may return
that set.
Time: O(n) average for n elements, plus the key or equivalence calls.
TypeError when elements is not iterable (null and undefined included) or the
options are invalid (both given, a key that is not a function, an equivalence without
equals and hash functions, or options that are not an object).
Returns an immutable set of the distinct elements of
elements, in first-seen order, deciding sameness byoptionsas aHashSetdoes: SameValueZero by default, a derivedkey, or anequivalence. The whole source is read before anykey,equalsorhashcall, so a callback that changes the source does not affect the result. Given a set this function or setOf returned with the samekeyorequivalence(or none on both), it may return that set.Time: O(n) average for
nelements, plus thekeyorequivalencecalls.