TypeScript · Junior · Question 40 of 75

What does implements do in a class?

Explanation

class Cat implements Animal - the compiler checks that the class has all the members of Animal. You have to write the implementation yourself, unlike extends for classes. Interfaces don't exist at runtime.

Further reading

Problem with a question

TypeScript · Junior · question 40

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