15 ms·
I'm surprised they're adding private fields when symbols already exist? Is it just for improved convenience?
by TazeTSchnitzel 5y ago
I'm surprised they're adding private fields when symbols already exist? Is it just for improved convenience?
- v413 5y agoObject properties defined as Symbols (even through classes) are still accessible by e.g. Object.getOwnPropertyDescriptors(myObject) Before the private fields, it was possible to create private properties through a WeakMap object which is somewhat clumsy and not very performant.