Reflect is a built-in JavaScript object for performing reflective operations on objects, especially when dynamic forwarding or inspection is needed. section 7.6.2
It pairs naturally with Proxy: the same internal operations exposed to proxy traps are available as Reflect methods, which makes forwarding behavior shorter and easier to read. section 7.6.2
Common uses here include:
- forwarding intercepted gets, sets, has, and similar object operations inside proxy traps. section 7.6.2
- checking whether a property definition or setter action succeeded with a Boolean result. section 7.6.2
- invoking callable behavior dynamically with methods such as Reflect.apply. section 7.6.2
Defaulting a proxy trap to Reflect
A get trap can log or transform one property, then hand the rest back to Reflect.get(target, key) so the proxy stays focused on the special case.
