Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Trigger debugger when something sets a specific property on an object
Array = new Proxy(Array, {
set(target, prop, value) {
if (prop === 'map') {
debugger;
}
return Reflect.set(target, prop, value);
},
defineProperty (target, prop, descriptor) {
if (prop === 'map') {
debugger;
}
return Reflect.defineProperty(target, prop, descriptor);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.