What I've also tried to epxlain in the very same post, is that Symbol unlocks new patterns for "secret" properties definition, and the following little WeakMap is just one example on how
symbols
can be used to relate data we don't want to show in other common ways.OK, maybe is not the most perfect polyfill we can have ... but you've got the idea on what could be done through
Symbol
variables ;-)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.