Last active
July 30, 2022 00:13
-
-
Save szaranger/4dc431ec226851008381bdc132ee8e3e 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 Person = { name: string }; | |
| const john: Person = { | |
| name: 'John', | |
| dob: '05/09/1982' | |
| // Object literal may only specify known properties and | |
| // 'dob' does not exist in type 'Person' | |
| }; | |
| const jane = { | |
| name: 'Jane', | |
| dob: '05/09/1982' | |
| } as Person; // No error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment