Last active
December 3, 2019 02:18
-
-
Save KATT/7765fa1bd61975776761584f5b0c5068 to your computer and use it in GitHub Desktop.
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
type Maybe<T> = T | null | undefined | |
function defaultValue<T>(value: Maybe<T>, fallback: T): T { | |
return value ?? fallback | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment