Sitemap
Stackademic

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

ES13 / ECMAScript2022

8. A Deep Dive into the Latest JavaScript Features — ES13

5 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 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.

--

--

✅ 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.