Created
November 6, 2017 21:09
-
-
Save gskachkov/a878fb79ed93d8c7f259814d70b84b1c 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 = { | |
get: function(target, property, receiver) { | |
if (property.startAt(0) === "_") return undefined; | |
return target[property]; | |
} | |
}; | |
const proxy = new Proxy({}, handler); | |
console.log(proxy.id); // 'ABCD' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment