Skip to content

Instantly share code, notes, and snippets.

@istarkov
Last active June 28, 2016 20:57
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save istarkov/8fde04649486619783f58643cbfcaa61 to your computer and use it in GitHub Desktop.
// 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