Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. interface Person {
  2. name: string;
  3. age?: number;
  4. }
  5.  
  6. const theDude: Person = { name: 'Dude' };
  7.  
  8. const twiceTheAge = 2 * theDude.age; // whoops - 'age' is possibly undefined
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement