Prototypes and classes
Explain the prototype chain and how classes are built on it.
- JS.04.01Objects, prototypes and the prototype chainCoreJunior9 min
- JS.04.02Constructor functions and `new`CoreJunior10 min
- JS.04.03ClassesCoreJunior11 min
- JS.04.04Inheritance patterns and compositionMid-levelBeing written
Interview questions in this module
- Explain prototypal inheritance.
- What is the difference between
__proto__andprototype? - What exactly does the
newkeyword do? - Are JavaScript classes just syntactic sugar? What is different from constructor functions?
- How do private fields (
#x) differ from closures or_xconventions? - How does
instanceofwork? Implement it. - What does
Object.create(null)give you and why use it? - Composition vs inheritance: when do you choose each?