Skip to content

Instantly share code, notes, and snippets.

@istarkov

istarkov/proxy.js

Last active Jun 28, 2016
Embed
What would you like to do?
// How to check array access
const arr = [];
const proxiedArr = new Proxy(arr, {
set(target, name, value) {
console.log(target, name, value);
// console.trace();
target[name] = value;
return value;
},
});
proxiedArr[1] = 101;
proxiedArr.push(1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment