Home > polyethylene > PolyAsyncIterable > filterNotNullish
Return an iteration of all the elements as this
that aren't null
or undefined
.
Signature:
filterNotNullish(): PolyAsyncIterable<NonNullable<T>>;
Returns:
PolyAsyncIterable<NonNullable<T>>
A new PolyAsyncIterable that yields the same elements as this
except for null
or undefined
values
This function is a shortcut to calling with a type predicate function that correctly filters out null
and undefined
values from the iteration. Note that other falsy values will remain in the iteration, and that the return value is correctly typed to exclude null
and undefined
.