TypeScript · Junior · Question 39 of 75

How do you extend an interface?

Explanation

An interface is extended with extends (from several at once: extends A, B). implements is used by classes to guarantee they match an interface. For type aliases, the counterpart is an intersection User & { role: string }.

Further reading

Problem with a question

TypeScript · Junior · question 39

Test yourself

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

Take this quiz