TypeScript · Middle · Question 42 of 75

How does type A = B differ from interface A extends B {} in IDE tooltips?

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.

Further reading

Problem with a question

TypeScript · Middle · question 42

Test yourself

Take the TypeScript · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz