JavaScript prototypes
JavaScript prototypes, prototype chain, and prototypal inheritance
Learn JavaScript prototypes with focused lessons on the prototype chain, prototypal inheritance, constructor function prototypes, native prototypes, prototype methods, objects without __proto__, classes, instanceof, mixins, and object-oriented JavaScript.
Prototype and inheritance lessons
Prototype chain
Follow how JavaScript looks up missing properties through an object's prototype chain.
Outcome: Explain inherited properties and methods without treating classes as magic.
- JavaScript prototype
- prototype chain
- prototypal inheritance
Constructor function prototypes
Learn how constructor functions share methods through the prototype property.
Outcome: Connect constructor functions to reusable object behavior.
- function prototype
- constructor prototype
- new operator prototype
Native prototypes
Understand built-in prototypes behind arrays, functions, strings, objects, and other native values.
Outcome: Reason about methods inherited from JavaScript built-ins.
- native prototypes
- built-in prototypes
- Array prototype
Prototype methods
Work with prototype methods and object creation patterns that avoid direct __proto__ usage.
Outcome: Use safer prototype APIs in modern JavaScript code.
- prototype methods
- Object.create
- objects without __proto__
Classes on top of prototypes
Connect class syntax to the same prototype model used by constructor functions and object inheritance.
Outcome: Read class code while understanding its underlying prototype behavior.
- JavaScript classes prototypes
- class syntax
- prototype class
Class inheritance
Use extends and super while understanding how class inheritance still relies on prototypes.
Outcome: Model specialized object types without losing the prototype mental model.
- class inheritance
- extends JavaScript
- super JavaScript
instanceof checks
Check values against constructor or class hierarchies and understand how instanceof follows prototypes.
Outcome: Validate object instances without confusing plain objects and class instances.
- instanceof JavaScript
- constructor check
- prototype check
Mixins and composition
Share behavior across class hierarchies with mixin patterns when single inheritance is too restrictive.
Outcome: Reuse object behavior without forcing every type into one inheritance tree.
- JavaScript mixins
- class composition
- prototype behavior