What's new in ES2022
We'll cover the following
- What’s new in ES2022
- Class Fields
- Class public Instance Fields & private Instance Fields
- Private methods and getter/setters for JavaScript classes
- Static class fields and private static methods
- Ergonomic brand checks for private Fields
- Class Static Block
- RegExp Match Indices
- Top-level await
- .at()
- Accessible Object.prototype.hasOwnProperty
What’s new in ES2022
Please note that most of the examples in this lesson won’t run on the Educative platform, to play around with them you can use the Chrome developer tools.
Let’s get started with the first of the new ES2022 features:
Class Fields
Class public Instance Fields & private Instance Fields
Before ES2022 we would define properties of a class
in its constructor
like this:
Get hands-on with 1400+ tech skills courses.