DEV Community

Discussion on: What is the use of Proxy and Reflect in JavaScript?

Collapse
 
sainig profile image
Gaurav Saini

I’m not too familiar with Reflect, but have a pretty good analogy for proxies that I’m sure will be helpful
If you know about Express and how the whole middleware pattern works, then proxies are exactly like middleware but for plain JavaScript objects. So, whenever you read from and object or make any changes to an object you can execute custom behaviour on those operations.
And as for the use cases, the only real ones I can think of is when you’re building some framework.

Collapse
 
rajeshroyal profile image
Rajesh Royal

really very good example 👌