Skip to content

Instantly share code, notes, and snippets.

@justinbmeyer justinbmeyer/weakmap.js forked from matthewp/weakmap.js
Last active Aug 29, 2015

What would you like to do?
function Private() { = 'is private';
Private.prototype.somePrivateFunction = function() { = 'bar';
function Public() {
privateThings.set(this, new Private());
Public.prototype.somePublicFunction = function() {
var myPrivate = privateThings.get(this);
// === 'is private';;
})(new WeakMap())
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.