• Extracts the first element matching the given condition from iterable.

    Type Parameters

    • T

      Iterated elements type.

    Parameters

    • iterable: Iterable<T>

      An iterable to extract element from.

    • test: ((this, element) => boolean)

      A predicate function to test elements. Returns truthy value for matching one. It accepts the tested element as the only parameter.

        • (this, element): boolean
        • Parameters

          • this: void
          • element: T

          Returns boolean

    Returns T | undefined

    Either the matching element, or undefined if no elements match.

Generated using TypeDoc