Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumJavaScriptProxy and ReflectSingle-choice MCQ

What does accessing p.val log, and why does the receiver matter here?

const base = { _v: 1, get val() { return this._v; } }; const handler = { get(t, key, receiver) { return Reflect.get(t, key, receiver); } }; const p = new Proxy(base, { ...handler }); const child = Object.create(p); child._v = 99; console.log(child.val);