Member-only story
ES13 / ECMAScript2022
8. A Deep Dive into the Latest JavaScript Features — ES13
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 ES13 / ECMAScript 2022 / ECMA2022, 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 ES13:
1. Top-level await
Top-level await is a feature in JavaScript that allows you to use the await keyword at the top level of your modules.
Traditionally(In ES8), the await keyword could only be used inside an async function, but with top-level await, you can use it directly at the top level of your module.
// Using top-level await
const result = await fetchData();
console.log(result);Note: await is only valid in async functions and the top level bodies of modules.
2. at() method for Strings Arrays
It allows you to access the character at a specified index in a String or the element at a specified index in an Array.









