Created
March 14, 2021 01:33
-
-
Save vmasek/cfb444ce15b142a3371055a3c02929ff to your computer and use it in GitHub Desktop.
Filter null & undefined predicate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const wololo: (string | number)[] = | |
['x', 42, null, undefined, 'foo'] | |
.filter(<T>(item: T | null | undefined): item is T => !!item); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment