Created
July 31, 2021 03:27
-
-
Save iiison/e14941c242645dd4f6e7c2e8aa8340f0 to your computer and use it in GitHub Desktop.
Revisions
-
iiison created this gist
Jul 31, 2021 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ var obj = { a : 'value', b : 'another value' } var objProxy = new Proxy(obj, { set(target, key, value) { console.log({ key, value }) if (key === 'b') { debugger } } }) obj = objProxy obj.a = 'test' // logs `a` as key and `test` as value