Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardJavaScriptprototype chain internalsSingle-choice MCQ

What does the final expression log, considering how the engine resolves an assignment when an accessor exists on the prototype?

const proto = { _x: 1, get x() { return this._x; }, set x(v) { this._x = v; } }; const obj = Object.create(proto); obj.x = 42; console.log(obj.hasOwnProperty('x'), obj.hasOwnProperty('_x'));