Proxy()
Proxy() is a JavaScript function in the Proxy category. Creates a Proxy. The syntax is new Proxy(target, handler). A typical example: new Proxy({}, {get(obj, prop) { return prop in obj ? obj[prop] : 42 }}). A close sibling is handler.get(), which traps property access. A close sibling is handler.set(), which traps property assignment. A close sibling is handler.has(), which traps the in operator. A close sibling is handler.construct(), which traps the new operator. More about this category: Proxy handlers for custom object behavior. Related Proxy methods: handler.get(), handler.set(), handler.has(), handler.construct(), handler.defineProperty(), handler.getOwnPropertyDescriptor(), handler.getPrototypeOf(), handler.setPrototypeOf(). This page is part of the free JS Reference documentation covering 1027+ methods, each with syntax, parameters, return values, examples, and common pitfalls. You can try Proxy() immediately in the JavaScript playground, look up unfamiliar terms in the glossary, or return to the JS Reference homepage.