What's the standard naming convention for a property's backing field? What's the standard naming convention for a property's backing field? typescript typescript

What's the standard naming convention for a property's backing field?


There is no code convention standard for TypeScript. Since it is a superset of JavaScript, following JavaScript code conventions would probably be the correct approach. In such a case you would use an underscore-prefixed property _status. Idiomatically, this also matches the compiler’s use of an underscore-prefixed _this for compiled arrow functions and underscored-prefixed _super for superclasses.


In C# as well as TypeScript we use private _status. In C# the property will be Status. In TypeScript as you mentioned it is status


I think it's safe to say at this stage that there is no standard.

If someone can point me to an authoritative standard or evidence of a de-facto standard, then I may consider accepting their answer instead.