Javascript Quiz: How well do you know Promise in Javascript #programming #javascript #coding #quiz

preview_player
Показать описание
Are you ready for another code challenge? Join me in this video as you test your coding knowledge with the simple quiz questions.

Don't forget to make your guess in the comments below.

-------------------------------------------------------------------------------------------

🔔Like and subscribe for more videos. 🔔

Connect me on linkedin :
------------------------------------------------------------------------------------------

Answer OPTION: A) 1, 2, 3

Explanation:
The code defines a generator function generator() that uses the yield keyword to generate promises resolved with values 1, 2, and 3.

Inside an immediately-invoked async function, a for await...of loop is used to iterate over the promises yielded by the generator.

The for await (const value of generator()) loop waits for each promise to resolve and assigns the resolved value to the value variable.

In each iteration, the resolved value is logged to the console.

Since the promises are resolved with values 1, 2, and 3, the output will be 1, 2, 3.
Рекомендации по теме
welcome to shbcf.ru