Home > polyethylene > PolyAsyncIterable > filter
Return an iteration of the elements of this
for which func(element)
returns true
.
Signature:
filter<U extends T>(func: IndexedTypePredicate<T, U>): PolyAsyncIterable<U>;
Parameter | Type | Description |
---|---|---|
func | IndexedTypePredicate<T, U> | The function to be called on all elements |
Returns:
PolyAsyncIterable<U>
A new PolyAsyncIterable with only elements for which func(element)
returned true and correctly narrowed to the type asserted by func
Because the func
argument is a type predicate, the result iteration will have the type asserted by func
.