Skip to content

Latest commit

 

History

History
23 lines (13 loc) · 1.03 KB

polyethylene.polyasynciterable.filternotnullish.md

File metadata and controls

23 lines (13 loc) · 1.03 KB

Home > polyethylene > PolyAsyncIterable > filterNotNullish

PolyAsyncIterable.filterNotNullish() method

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

Remarks

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.