Es2022

Deep dive into public and private instance fields in JavaScript (ECMAScript 2022)

Class fields declaration allows declaring fields, up-front making class definitions become more self-documenting. As declared fields are always present, instances go through fewer state transitions. These class fields features would be officially included in ECMAScript 2022.

Private fields, methods and, accessors in JavaScript

The class fields proposal provides private fields for classes and instances to JavaScript. With this proposal, any class element can be private.