Skip to content

Instantly share code, notes, and snippets.

@L8D L8D/wm.js

forked from gajus/wm.js
Last active Aug 29, 2015
Embed
What would you like to do?
let wm = new WeakMap();
class Foo {
constructor () {
var privateData = {};
wm.set(this, privateData);
privateData.myProperty = 1;
}
getMyProperty() {
var privateData = wm.get(this);
return privateData.myProperty;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.