Last active
August 29, 2015 14:12
-
-
Save iksose/4ca3772785f54005123a to your computer and use it in GitHub Desktop.
es6 symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const privateFoo = Symbol("foo"); | |
function Public() { | |
this[privateFoo] = "bar"; | |
} | |
Public.prototype.method = function () { | |
// Do stuff with `this[privateFoo]`... | |
}; | |
module.exports = Public; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://fitzgeraldnick.com/weblog/53/