Created
August 9, 2020 11:46
-
-
Save jaycosaur/2e466fc004d08703d305349cad57d880 to your computer and use it in GitHub Desktop.
Intersection types [typescript] - Typescript to Python field guide
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 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