Proxy and Reflect

new Proxy(target, handler) returns an object that routes each fundamental operation (reading, writing, in, delete, calling, new, Object.keys() ...) to a handler method called a trap. A missing trap falls through to the target. Reflect is a namespace, not a constructor, whose 13 static methods share the traps' names and arguments and perform the default behavior, so a trap typically does its extra work and then calls Reflect.<trap>(...).

The 13 proxy traps; each has a same-named Reflect method
Trap Intercepts Returns
apply / construct f() / new F() any value / object
get / set p.x, p[k] / p.x = v value / boolean
has / deleteProperty k in p / delete p.x boolean
defineProperty Object.defineProperty() boolean
getOwnPropertyDescriptor same-named Object method descriptor or undefined
ownKeys Object.keys(), for...in array of keys
getPrototypeOf instanceof, __proto__ object or null
setPrototypeOf Object.setPrototypeOf() boolean
isExtensible / preventExtensions same-named Object methods boolean

Subsections