Question Bank
/

Proxy, Reflect, and Symbol Quiz

Proxy, Reflect, and Symbol Quiz

Four metaprogramming drills: a logging Proxy, a Proxy-backed data binding, Symbols as private keys, and the Reflect API for safer dynamic property work.

Question Bank
Hard
JavaScript
quiz
js-proxy-reflect
js-symbols
js-language

202 views

3

Wrap userData in a Proxy whose get trap logs every property access before returning the value.

Examples

Example 1:

Input: const p = new Proxy({ name: 'Alice', age: 25 }, handler); p.name
Output: logs 'Accessing name: Alice', returns 'Alice'
Explanation: The `get` trap intercepts property reads; do the logging then return `target[property]`.

3 more questions, with full solutions and explanations, are available for premium members.

Upgrade to Premium