Sitemap
Stackademic

Stackademic is a learning hub for programmers, devs, coders, and engineers. Our goal is to democratize free coding education for the world.

ES11 / ECMAScript2020

6. A Deep Dive into the Latest JavaScript Features — ES11

4 min readFeb 15, 2024

--

Press enter or click to view image in full size

The JavaScript has been evolved a lot and one of the widely used language in the world. We are discussing about some core feature of ES11 / ECMAScript 2020 / ECMA2020, the iteration of the ECMAScript standard. Let’s talk about exciting features that can streamline your workflow and enhance your code.

In this article, we’ll delve into some of the key features introduced in ES11:

1. Private Class Variables

We can use private variables inside class using #

class Person {
#name = 'JS';
getName() {
return this.#name;
}
}

const person = new Person();

console.log(person.getName()); // JS
console.log(person.#name); // throws error

2. Static Fields

class Person {
static name = 'JS';
getName() {
return Person.name;
}
}

const person = new Person();

console.log(person.getName()); // JS
console.log(Person.name); // JS

3. Promise.allSettled

It is used to handle multiple promises concurrently.

Unlike Promise.all, which rejects immediately if any promise in the array rejects.

--

--

✅ open src 🚀 🚀
✅ open src 🚀 🚀

Written by ✅ open src 🚀 🚀

1. Open source contributor, Architect at Jio Platform Ltd. and The Author of fe-pilot. https://github.com/opensrc0/fe-pilot/

Stackademic
Stackademic

Published in Stackademic

Stackademic is a learning hub for programmers, devs, coders, and engineers. Our goal is to democratize free coding education for the world.