You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure what you're asking for here. The coding guidelines are for our own codebase and are not meant to be the only correct way to write TypeScript code; other codebases do commonly use _ as a private prefix and it's useful in the example because the backing field and the name itself otherwise have the same spelling so it's more clear what the relation between them is.
Thanks for the response and I do agree and see the benefit of using the _ for a private prefix. For one I thought the coding guidelines where an overall recommendation and thanks to your correction I can see I was assuming wrongly.
TypeScript Version: 2.0.3
Code
Expected behavior:
Based on the
Names
Coding Guidelines#6
it states:Do not use "_" as a prefix for private properties.
However the sample code uses the underscore for provide properties:
source: https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Classes.md#accessors
Actual behavior:
A different demonstration for private properties specially around accessors.
The text was updated successfully, but these errors were encountered: