Function pickAny

  • Pick any arbitrary element from the container.

    Type Parameters

    • T

    Parameters

    • container: Pick<ReadonlySet<T>, "values">

      Presumably a Map or a Set. Something with a .values() iterator.

    Returns T | undefined

    An item in the set or a value from the map. Unless the input is empty, then this returns undefined.