Last active
January 9, 2020 12:16
-
-
Save fluidsonic/d0c778c6c8fc6fe8c255f730f498b9e6 to your computer and use it in GitHub Desktop.
This file contains 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
interface Foo { | |
a: number; // no b | |
} | |
interface Bar { | |
a: number; b: string | |
} | |
function logB(value: Merge<Foo | Bar>) { | |
console.log(value.b) // .b is now an optional 'string' property | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment