Latest ES Version
ECMAScript 2020, also known as
Some of the biggest changes in
Optional chaining: ES2020 introduces the optional chaining operator (?.), which allows you to safely access properties of an object without having to check if the object or property exists. This can make it easier to write code that deals with nested objects and can reduce the need for lengthy conditional statements.
Nullish coalescing: ES2020 also introduces the nullish coalescing operator (??), which allows you to provide a default value for a variable if it is null or undefined. This can be useful for handling cases where a variable may not have a value and you want to provide a default instead.
Promise.allSettled()method was added in ES2020 and allows you to wait for all of the promises in an array to either fulfill or reject. This can be useful for handling multiple asynchronous operations and can make it easier to write code that works with promises.
Dynamic import: ES2020 adds support for dynamic import, which allows you to import a module or script at runtime instead of at the top of a file. This can be useful for lazy loading parts of your code and can improve the performance of your applications.
Which browsers support ES2020?
All modern web browsers support the ECMAScript (ES) standards to some extent. However, the level of support for each version of the language can vary between different browsers.
For example, the latest version of Google Chrome (version 85) supports all of the features of ES2020, as well as most of the features of ES2019 and some of the features of ES2018. Mozilla Firefox (version 80) also supports all of the features of ES2020, as well as most of the features of ES2019 and some of the features of ES2018.
On the other hand, Microsoft Edge (version 85) supports all of the features of ES2020, as well as most of the features of ES2019 and ES2018. Apple Safari (version 14) also supports all of the features of ES2020, as well as most of the features of ES2019 and ES2018.
Overall, the level of support for the different ES standards varies between different web browsers, but most modern browsers support the latest versions of the language to a high degree. It is always a good idea to check the level of support for each version of the language before using it in your projects.
Did you find this article valuable?
Support 0xTristan by becoming a sponsor. Any amount is appreciated!