Last active
November 6, 2017 20:34
-
-
Save gskachkov/125ab788eeed41a945b31349ee8a3130 to your computer and use it in GitHub Desktop.
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 characters
const handler = { | |
defineProperty: function(target, property, descriptor) { | |
if (property.charAt(0) === "_") return false; | |
return Reflect.defineProperty(target, property, descriptor); | |
} | |
}; | |
const proxy = new Proxy({}, handler); | |
proxy.id = "ABCD"; // { id: 'ABCD' } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment