Skip to content

Instantly share code, notes, and snippets.

@jonathanmarvens
Created November 13, 2013 22:09
Show Gist options
  • Save jonathanmarvens/7457338 to your computer and use it in GitHub Desktop.
Save jonathanmarvens/7457338 to your computer and use it in GitHub Desktop.
function createStorage() {
var
_,
map
;
map = new WeakMap();
return (function (object) {
var
store
;
if (! store) {
map.set(object, (store = Object.create(null)))
}
return store;
});
_ = createStorage();
function Player() {
_(this).lifeCount = 3;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment