Materialises source into an enumerable set containing the distinct elements.
Type of elements within source.
The source iterable.
A set populated with the distinct elements from source.
The entire sequence is enumerated immediately and duplicate elements are collapsed using the set's equality semantics.
const numbers = [1, 2, 2, 3, 1];const set = toEnumerableSet(numbers);console.log(set.toArray()); // [1, 2, 3] Copy
const numbers = [1, 2, 2, 3, 1];const set = toEnumerableSet(numbers);console.log(set.toArray()); // [1, 2, 3]
Materialises source into an enumerable set containing the distinct elements.