Problem Statement
How does JavaScript handle property lookup on objects?
Explanation
If a property isn’t found on the object itself, JavaScript continues searching in the object’s [[Prototype]] chain until it finds the property or reaches null.
Code Solution
SolutionRead Only
const proto = { kind: 'proto' };
const obj = Object.create(proto);
obj.name = 'JS';
console.log(obj.kind); // 'proto' via prototypePractice Sets
This question appears in the following practice sets:
