Function filter

  • Returns a new array containing the values from iterable, in order, for which the given test function returns true. Equivalent to array.filter.

    Type Parameters

    • T

    Parameters

    • iterable: Iterable<T>
    • test: ((value, index, iterable) => unknown)
        • (value, index, iterable): unknown
        • Parameters

          • value: T
          • index: number
          • iterable: Iterable<T>

          Returns unknown

    Returns T[]