getSet()function

getSet(value: PossibleSet<T>): ImmutableSet
ParamType
valuePossibleSet<T>
A Set or any iterable of items. required
Return
ImmutableSet
A Set containing the items of value.

Convert a possible set to a Set.

  • Returns the input unchanged when it is already a Set; otherwise constructs a new Set from the iterable.

Examples

getSet(["a", "b"]) // Set { "a", "b" }