SEARCH
You are in browse mode. You must login to use MEMORY

   Log in to start


From course:

TypeScript

» Start this Course
(Practice similar questions for free)
Question:

What is the basic rule for TypeScript's structural type system?

Author: Kate W



Answer:

X is compatible with y if y has at least the same members as x. interface Pet { name: string; } let pet: Pet; // dog's inferred type is { name: string; owner: string; } let dog = { name: "Lassie", owner: "Rudd Weatherwax" }; pet = dog;


0 / 5  (0 ratings)

1 answer(s) in total

Author

Kate W
Kate W