Engrain by ByteRush

JS.04 4 concepts · 3 ready

Prototypes and classes

Explain the prototype chain and how classes are built on it.

  1. JS.04.01Objects, prototypes and the prototype chainCoreJunior9 min
  2. JS.04.02Constructor functions and `new`CoreJunior10 min
  3. JS.04.03ClassesCoreJunior11 min
  4. JS.04.04Inheritance patterns and compositionMid-levelBeing written

Interview questions in this module

  1. Explain prototypal inheritance.
  2. What is the difference between __proto__ and prototype?
  3. What exactly does the new keyword do?
  4. Are JavaScript classes just syntactic sugar? What is different from constructor functions?
  5. How do private fields (#x) differ from closures or _x conventions?
  6. How does instanceof work? Implement it.
  7. What does Object.create(null) give you and why use it?
  8. Composition vs inheritance: when do you choose each?