About # and 'private'. Why not '#private' ? #60275
Labels
Out of Scope
This idea sits outside of the TypeScript language design constraints
Suggestion
An idea for TypeScript
Acknowledgement
Comment
I was thinking about this topic : #31670
The conversation can go on.
The facts :
private
is a Typescript keywordprivate field
does not get transpiled into#field
or any constraining code, as per Typescript philosophy.#
is Javascript syntax.#
is considered awkward by many Typescript devs, because:private
would be used for in the vast majority of OOP languages.There's got to be a way of getting the best of both.
What do you think of this ?
#private field: number
. Then in Typescript it's used normally:this.field = 12;
. In Javascript it's compiled asthis.#field = 12;
The text was updated successfully, but these errors were encountered: