JavaScript · Middle · Question 8 of 75

What are classes in JavaScript really?

Explanation

Class methods go into Class.prototype, and extends builds the prototype chain. But there are differences from constructor functions: a class can't be called without new, its body runs in strict mode, methods are non-enumerable, and there are private #x fields and static.

Further reading

Problem with a question

JavaScript · Middle · question 8

Test yourself

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

Take this quiz