TypeScript · Middle · Question 11 of 75

What is declaration merging?

Explanation

Interfaces, namespaces and some other declarations with the same name merge. That's how global types are extended: interface Window { analytics: Analytics } in declare global. type aliases don't merge - redeclaring one is an error.

Further reading

Problem with a question

TypeScript · Middle · question 11

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