Skip to content

Instantly share code, notes, and snippets.

@jaycosaur
Created August 9, 2020 11:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaycosaur/2e466fc004d08703d305349cad57d880 to your computer and use it in GitHub Desktop.
Save jaycosaur/2e466fc004d08703d305349cad57d880 to your computer and use it in GitHub Desktop.
Intersection types [typescript] - Typescript to Python field guide
type HasAge = { age: number };
type HasName = { name: string };
type HasNameAndAge = HasName & HasAge;
const correct: HasNameAndAge = { name: "Tim", age: 23 };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment