liveBook · Manning

Proxy

A JavaScript Proxy is an object that intercepts operations on a target object through trap functions defined by a handler.

How 2 Manning books explain it

Secrets of the JavaScript Ninja, Second Edition

A JavaScript object that intercepts operations on a target object using a handler.

How it is used
Uses proxies to control object access and add cross-cutting concerns such as logging and performance measurement.
How deep it goes
Explains get, set, and apply traps through worked examples, without surveying other traps.
Examples
Uses a Ninja object for property logging and an isPrime function for call timing.
What you can do after
Apply Proxy traps to log property access and measure function-call duration without modifying target code.

Read how Secrets of the JavaScript Ninja, Second Edition explains Proxy →

Secrets of the JavaScript Ninja, Third Edition

Proxy is a JavaScript built-in object type that mediates operations on a target object through configurable interception functions.

How it is used
Mediates object interactions to add custom behavior such as logging, validation, or computed properties.
How deep it goes
Explains target and handler mechanics, several traps, and Reflect forwarding, without detailing the full trap list.
Examples
Uses an emperor object to demonstrate reading, updating, and restricting properties through a proxy.
What you can do after
Build a proxy that customizes property reads and assignments while forwarding permitted operations to its target.

Read how Secrets of the JavaScript Ninja, Third Edition explains Proxy →

Also covered in

Related concepts

Questions about Proxy

What is Proxy?

A JavaScript Proxy is an object that intercepts operations on a target object through trap functions defined by a handler.

Which Manning books explain Proxy?

Secrets of the JavaScript Ninja, Second Edition and Secrets of the JavaScript Ninja, Third Edition.

What is the difference between Proxy and getter?

A JavaScript Proxy is an object that intercepts operations on a target object through trap functions defined by a handler. A property accessor that executes code and returns a value when the property is read.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.