Prototype Concept Check
Question
How does property lookup work on a JavaScript object?
Hint
JavaScript uses prototypal inheritance with a chain.
Explanation
When you access a property, JavaScript first checks the object's own properties. If not found, it checks the object's prototype (via __proto__ or Object.getPrototypeOf), and continues up the prototype chain until the property is found or the chain ends at null. This is how inheritance works in JavaScript — objects inherit from their prototype.
Related Resources
Related Lessons
- JavaScript Objects
Learn about prototypes.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.