Working With ECMAScript 2019 Asynchronous Iteration Using “for-of”

How to use “for-of” loops in ECMAScript 2019

This article is focused on the concept of Asynchronous Iteration, which is available in ECMAScript 2019. The“for-of” loop is often used to iterate through the list of items inside a loop. We can now use the “for-of” loop in JavaScript to iterate through the list of Promises and provide the value received when the Promise is resolved.

Let's iterate through an array of numbers using the “for-of” loop: