|
|
|
|
|
by Klathmon
2712 days ago
|
|
I feel like i'm spamming this link every time the private fields stuff comes up, but take a look at the FAQ, it explains the reasoning behind it and why they didn't go with alternate options (like underscore, private, or others). I was against it at first, but after reading through that document, i'm on their side now. It'll be a small but useful addition in some situations, and it's scope is extremely limited. https://github.com/tc39/proposal-class-fields/blob/master/PR... |
|
> this is already a source of enough confusion in JS; we'd prefer not to make it worse
> Property access semantics are already complicated, and we don't want to slow down every property access just to add this feature.
> [private x] in JavaScript this would silently create or access a public field
Pardon me, but # as a declaration method of privates is an abomination.