Similar to a question I had some time back: Private properties in JavaScript ES6 classes
This question has more to do with the emergence of using WeakMaps and Symbols to store private variables. Since I would be declaring any private member structures at the top of the file, wouldn't this require a function closure around all of it?
const _color = Symbol('color');
class colorPicker {
constructor(color) {
this[_color] = color;
}
}
The _color is now gonna be in the window namespace, even if not hoisted. Is this proper ? or should the IIFE be wrapped around it?
Seems like ECMA may have missed something with this? Or do they intend to actually use private and public reserved keywords in ESNext?