JS Built-ins
Prototypesintermediate

Prototypes β€” Property inheritance through Object.create

πŸ“– Usage Example
const proto = { type: 'vehicle' };
const car = Object.create(proto);
car.brand = 'Toyota';
car.type; // 'vehicle' (inherited)

Objects inherit properties from their prototype without copying them.

Inheriting Properties Across Multiple Levels

When you chain Object.create() calls, you create multi-level inheritance. Properties are inherited through the entire chain, allowing sophisticated object hierarchies.

Challenge: Create a multi-level inheritance hierarchy using Object.create().

πŸ’‘ Hints (3)
  • β€’ Each Object.create() call adds a new level to the chain
  • β€’ Properties can be overridden at any level
  • β€’ The entire chain is searched for property access