Last active
June 28, 2016 20:57
-
-
Save istarkov/8fde04649486619783f58643cbfcaa61 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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