2 ms·
The justification is that they needed a unique accessor, because: - attempting to access a non-existent private property using `this.prop` would create a publi
by lucideer 8y ago
The justification is that they needed a unique accessor, because:
- attempting to access a non-existent private property using `this.prop` would create a public property "prop" in JS, which they claim would be a source of bugs.
- they also wanted to allow creating a public property on a subclass with the same name as a private property on a parent class—having the accessors the same could be confusing.
That said, they could still have had keywords for definition with an alternative accessor. # is definitely not idiomatic; it's extremely ugly.