Skip to content

Instantly share code, notes, and snippets.

@fluidsonic
Last active January 9, 2020 12:05
Show Gist options
  • Save fluidsonic/2ca84c54b64e603ab6e1137b095760e8 to your computer and use it in GitHub Desktop.
Save fluidsonic/2ca84c54b64e603ab6e1137b095760e8 to your computer and use it in GitHub Desktop.
interface Foo {
a: number; // no b
}
interface Bar {
a: number; b: string
}
function logB(value: Foo | Bar) {
console.log(value.b) // We cannot access .b as it isn't defined on Foo.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment