Your product could be here, in front of thousands of JavaScript developers. Sponsor this spot →
JavaScript Quiz

JavaScript Classes and Prototypes Quiz

JavaScript classes are built on prototypes. Objects look up missing properties on their prototype chain, and a class is really a special kind of function.

These questions cover the prototype chain, static, getters, private fields and constructor behavior.

Classes & Prototypes questions

  1. Why does this become undefined when you extract a method?
  2. What happens when a constructor returns an object?
  3. Do objects see prototype changes made after they're created?
  4. Are JavaScript classes hoisted?
  5. Can you call a static method on a class instance?
  6. What is the difference between in and hasOwnProperty?
  7. What is typeof a class in JavaScript?
  8. What happens when you assign to a getter-only property?

More topics