Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface Person {
- name: string;
- age?: number;
- }
- const theDude: Person = { name: 'Dude' };
- const twiceTheAge = 2 * theDude.age; // whoops - 'age' is possibly undefined
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement