What they're testing
Whether you have a model of property lookup, or use class as if it were Java.
The short answer~30 seconds
Every object holds an internal link to another object, its prototype. Reading a property the object doesn't have makes the engine walk that chain until it finds one or reaches null. class introduces no new model — it creates a constructor function and hangs methods on Constructor.prototype; it's nicer syntax with a few stricter rules.
The long answer
The chain governs READS, not writes. Assigning obj.x = 1 always creates the property directly on obj, shadowing any same-named prototype property rather than modifying it. That's a classic confusion: mutating a child object appears to affect the parent, when it only created a shadow. The exception is a prototype-defined setter, which does get invoked.
The practical consequence that matters most is why patching built-in prototypes is a bad idea. Adding Array.prototype.last means every array in the entire process — including inside third-party libraries — suddenly has it, and for…in will enumerate it. If another library defines last with different semantics, one of them breaks, and the error appears somewhere entirely unrelated.
The real differences between class and an old-style constructor: class bodies are always strict, methods aren't enumerable in for…in, calling a class without new throws immediately, and extends correctly handles subclassing built-ins like Array, which the old pattern managed only awkwardly. So class isn't purely cosmetic — it also closes a few common holes.
What they'll ask next
?__proto__ versus prototype?
prototype is a property on FUNCTIONS, used as the prototype of objects created with new. __proto__ (standardised as Object.getPrototypeOf) is an object's actual link to its prototype. Conflating them is the single most common misunderstanding here.
?What's Object.create(null) for?
Creating an object with no prototype, so no toString, no hasOwnProperty, and crucially no __proto__. It's the safe dictionary for user-supplied keys — and the standard defence against prototype pollution.
These lose points
- Saying JavaScript
classis like Java's. No static types, no overloading, no true privacy before#, and inheritance is still prototypal.