• Creates a push iterable with all array elements extending the given type.

    Type Parameters

    • T

      A type of array elements.

    • TTarget

      Target type.

    Parameters

    • array: ArrayLike<T>

      A source array.

    • test: ((this, element) => element is TTarget)

      A predicate function to test that element extends the type TTarget. Returns true to keep the element, or false otherwise. It accepts the tested element as the only parameter.

        • (this, element): element is TTarget
        • Parameters

          • this: void
          • element: T

          Returns element is TTarget

    Returns PushIterable<TTarget>

    New push iterable with the elements that pass the test. If no elements passed the test, an empty iterable will be returned.

  • Creates a push iterable with all array elements that pass the test implemented by the provided function.

    Type Parameters

    • T

      A type of array elements.

    Parameters

    • array: ArrayLike<T>

      A source array.

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

      A predicate function to test each element. Returns true to keep the element, or false otherwise. It accepts the tested element as the only parameter.

        • (this, element): boolean
        • Parameters

          • this: void
          • element: T

          Returns boolean

    Returns PushIterable<T>

    New push iterable with the elements that pass the test. If no elements passed the test, an empty iterable will be returned.

Generated using TypeDoc