Question:
What is the basic rule for TypeScript's structural type system?
Author: Kate WAnswer:
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