Advertisement
Guest User

Untitled

a guest
May 27th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. const friend = {};
  2. friend.name = 'John'; // Error! Property 'name' does not exist on type '{}'
  3.  
  4. interface Person {
  5. name: string;
  6. age: number;
  7. }
  8.  
  9. const person = {} as Person;
  10. person.name = 'John'; // Okay
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement