Skip to content

Instantly share code, notes, and snippets.



Forked from gajus/wm.js
Last active Aug 29, 2015
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