TypeScript · Middle · Question 42 of 75
How does type A = B differ from interface A extends B {} in IDE tooltips?
- ✓Correct answer: The interface is shown by name, the alias gets expanded
- 2Type aliases aren't shown in IDE tooltips at all
- 3No difference: the IDE shows them the same way
Explanation
Complex intersections and mapped types are often expanded into long structures in tooltips, while an interface is shown by name. This affects the readability of errors. To "flatten" intersections, people write a Prettify<T> helper.