👩💻 Join our community of thousands of amazing developers!
The ECMAScript proposal “Class static initialization blocks” by Ron Buckton is at stage 4 and scheduled to be included in ECMAScript 2022. For setting up an instance of a class, we have two constructs in JavaScript: Field: Create (and optionally initialize) instance properties. Constructor: A block of code that is executed before setup is finished. For setting up the static part of a class, we only have static fields. The ECMAScript proposal introduces static initialization blocks for classes,...