JavaScript: How the event loop executes setTimeout() and Promise

preview_player
Показать описание
The event loop is the implementation by the help of which Javascript handles the asynchronous task(s). Altho setTimeout and Promise both are an asynchronous task but event loop handles them differently.

In the event loop, we have two types of Queue for a different type of task i.e MicroTask queue and Task queue also known as callback queue. In this video, I try to explain the basic concept of the event loop and event loop works in the V8 engine.

#EvenLoop #SetTimeout #Promises

Thanks for watching the video...
Рекомендации по теме
Комментарии
Автор

Node's and browser's event loop are very much different, in browser setTimeout first calls timer that is browser api. and then in callbackqueue function is inserted and event loop check all time that call stack is empty or not.then after the function execute.
In node there are 6 queue for different call back handling.

chetanupreti
Автор

Наверно индусы обожают подобные видео, ну почему же из моих ушей льется кровь!?)

eugenegronski
Автор

hello please send the Event Loop Video link

nescreation
Автор

The overall explanation is fine, but not that accurate and this video covers too shallow. The event loop mechanism between node and browser is very different.

edwardhu
Автор

Chilla chilla k scheme btade sabko :P
~Akshay kumar

mildtime
Автор

Good explanation, but it's browser, not browjer, Thanks

tanzeembhatti