Reflect and Proxy have completely different goals and different capabilities.
MDN describes proxies as follows :
A Proxy object is used to define user behavior for basic operations (for example, searching for properties, assigning, listing, calling functions, etc.).
And reflect in this way :
Reflection is a built-in object that provides methods for intercepting JavaScript operations. The methods are the same as the proxy handler methods.
I understand that you probably already read this, so I will use the example to explain it further.
Let's say you have an object:
const obj = { a: 'foo', b: 'bar', };
You can access property a with this property:
console.log(obj.a); // 'foo'
You can do the same with the Reflect.get() method:
console.log(Reflect.get(obj, 'a'));
You can also create proxies for this object using the Proxy constructor. We will use the get handler to intercept all property searches.
const proxy = new Proxy(obj, { get(target, property) { return property in target ? target[property] : 'default'; }, });
Now, using either the accessor property or Reflect.get() to get the undefined property, we get the string 'default' :
console.log(proxy.c); // 'default' console.log(Reflect.get(proxy, 'c')); // 'default'
Proxy and Reflect can work great together. For example, you can create a proxy with a no-op get handler using Reflect:
new Proxy(obj, { get: Reflect.get, });