JavaScript is a prototype-based language. While modern 'Classes' provide a cleaner syntax, prototypes remain the underlying engine that makes it all work.
1The Lookup Chain
When you access a property, JavaScript performs a recursive search. It starts at the object itself. If not found, it jumps to its [[Prototype]] (accessible via __proto__). This continues until the property is found or the chain reaches null. This mechanism allows for massive memory savings, as thousands of objects can share a single set of methods stored on a common prototype.
2Shadowing & Object.create
Property shadowing occurs when an object has its own property that 'hides' one on the prototype. This is fundamental for overriding behaviors. For creating objects with specific lineages, Object.create() offers a more direct way to establish a prototype relationship without the overhead of a constructor function.
