Skip to content

Instantly share code, notes, and snippets.

@iksose
Last active August 29, 2015 14:12
Show Gist options
  • Save iksose/4ca3772785f54005123a to your computer and use it in GitHub Desktop.
Save iksose/4ca3772785f54005123a to your computer and use it in GitHub Desktop.
es6 symbols
const privateFoo = Symbol("foo");
function Public() {
this[privateFoo] = "bar";
}
Public.prototype.method = function () {
// Do stuff with `this[privateFoo]`...
};
module.exports = Public;
@iksose
Copy link
Author

iksose commented Dec 24, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment