Why not use the private/public keywords like in TypeScript?
Was this # thing voted by the community or something?
Was this # thing voted by the community or something?
- 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.