• Returns the elements of an array that meet the condition specified in a callback function.

    ts.filter(pred)
    

    But also works with generators.

    Type Parameters

    • T

    Parameters

    • ts: Iterable<T>

      list of things

    • pred: ((t) => boolean)

      function to check if thing is valid

        • (t): boolean
        • Parameters

          • t: T

          Returns boolean

    Returns IterableIterator<T>

    Yields

    each valid thing

Generated using TypeDoc