@@Java.Brains It really helped out many persons. I am also one of them. Following you since your jaxrs courses came out. Thanks a lot for your effort. Happy Independence day...
This is the clearest explanation of JS's event queue, call stack and event loop I have ever seen on RUclips. I really appreciate the effort you put into making these videos simple and clear. Great work JB!
This tutorial taught Callback, Synchronous & Asynchronous and Event Loop in the most easiest way possible. Watched many long videos but only 8:26 seconds was enough!
This channel has quality written all over it. Online and offline put together, teachers like you are hard to find. All I can do is write a comment here to thank you. Keep up the good work! :)
Amazing explanation! But I always wonder how the V8 runtime knows when some API call has returned or setTimeout is done. Is there a separate listener thread whose whole purpose is to wait for asynchronous callbacks so it can add them to the event queue?
Wow! I actually studied JS Event loop before. As you said, many tutorials and JS Conf Talks helped me understand the concept better. But to me, the amazing analogy that you used and your awesome explanation, was the simplest one so far. Thank you so much, man!
I think you have the best videos on Javascript period. You take basic concepts and turn them into advanced concepts, yet I still understand what you are saying. You are a great teacher. Well done. Your "Introduction to Javascript for Developers" series is my most favorite Javascript series on RUclips. Very well done. Permanent bookmark:-)
Is it just a coincidence that when I was learning java and spring koushik was also into it, and I'm now learning javascript, he's also doing the same :)
@@Java.Brains hah But seriously, you've helped me a lot, and many others ofcourse. I found out the java road map video to be very helpful. If you could bring a similar sort of video for javascript, it would be really helpful.
For the first time I saw how someone was able to explain the event loop with some kind of analogy from real life, I think this is what a lot of people on RUclips lack, thank you very much for your efforts!
Thanks, sir. However, I still have a question. For example, in my restaurant, 100 customers arrive simultaneously and they all want to order food. As you mentioned, we only have 1 waiter (thread). In this scenario, all customers will shout out, complain, and might not return to my restaurant next time.
Really missed you Kausik please please make videos frequently , I always eagerly waiting for your video they are always best as compared to other RUclips videos
tons of one hour duration videos about event loop, beautiful presentations jokes and no concrete info, why there is not videos like this. short and clear
Is that "while isNotEmpty(eventQueue)" loop running in the same thread or some JS engine level separate dedicated thread whose job is only to keep checking the eventQueue?
Hi Kaushik I could not find complete javascript course on Java brains website. I was looking to purchase it but its not there now. I wanted to purchase it because of two reasons 1. I have purchased hundreds of courses around programming on several platforms, but your courses are at the top when it comes to quality. 2. I wanted to purchase as a token of appreciation for all your hard work. Please guide where can I purchase complete javascript course.
Event loop is a loop that are checking calstack continuously. if call stack is empty it push event that are waiting in event queue into the call stack for exicution perpose.
sadly you didn't explain what the chef in your example is exactly and WHY Javascript is able to go one without waiting for the task to finish. you didn't mention the web api. a little bit disappointed
I have to get json api data get every 2 second and make chart as per the json data. What should I use to 2 second get refreshed data of json. And this will be 24*7.
who is the chef in JS that the waiter handovers the task to? Like waiter is the single execution thread you mentioned and who is the chef refers to in JS
Hi Kaushik, great content and explanation as always. Could you also please explain macrotasks and microtasks as well? I've gone through some documentation on the same, but as you mentioned, they seems to be more complicated explanations.
Remember - it's a single application thread. Other runtime concerns like queuing events, call stacks, memory management etc is managed by the runtime and does not involve the application thread.
Agreed. I feel like socket.io doesn't get the attention it deserves. I usually struggle to find dynamic and diverse content on its use in production environments. Sadly the last release of socket.io on NPM was a year ago, so that doesn't help things :(.
Thank you so much for making this video, I'm grateful for the fact that the quantity of event loop tutorial videos on RUclips didn't stop you from making this video.
Hi Sir, Just to clarify.. suppose I have three functions in a js file. Will all three of them will be placed in event queue? If no, then how come setimeout places the function in event queue?
Koushik you are awesome ..The Best on youtube ..thank you and apreciate a lot for such amazing detailed conceptual videos..COULD YOU PLEASE DO A SERIES ON DATA STRUCTURES BOTH CONCEPTS AND IMPLEMENTATION IN JAVASCRIPT ..would be very grateful..Ty
Appreciate your effort you put to make videos. I Learned a lot from your videos over last 5 years. Many Thanks Kaushik :)
Thanks! Yes, it does take a lot of time to produce these kind of videos, but I am glad they help! :)
@@Java.Brains It really helped out many persons. I am also one of them. Following you since your jaxrs courses came out. Thanks a lot for your effort. Happy Independence day...
@@Java.Brains How do you do the animations ?
@@Java.Brains Didn't know ,this complex looking concept was so so easy.Thnxx a ton.
Simply You can make a program that can make 1 million likes for you !
I wish I can like this video a million times.
If you click in even number of times it doesn't going to help
😂
Can be done using phython
Your likes would get stuck in the event queue
This is the clearest explanation of JS's event queue, call stack and event loop I have ever seen on RUclips. I really appreciate the effort you put into making these videos simple and clear. Great work JB!
This tutorial taught Callback, Synchronous & Asynchronous and Event Loop in the most easiest way possible. Watched many long videos but only 8:26 seconds was enough!
did you mean 506 seconds?
You are a beast my friend , this is the really easiest way to understand event loop , thank you so much
"If you can't explain it simply, you don't understand it well enough" - Albert Einstein
This suits you man.. what an explanation!!
This channel has quality written all over it. Online and offline put together, teachers like you are hard to find. All I can do is write a comment here to thank you. Keep up the good work! :)
Amazing explanation! But I always wonder how the V8 runtime knows when some API call has returned or setTimeout is done. Is there a separate listener thread whose whole purpose is to wait for asynchronous callbacks so it can add them to the event queue?
This guy made my Weekend.
Thanks koushik
the chef is also a worker thread in this analogy, am I missing something? there is one waiter thread and chef thread?
Wow! I actually studied JS Event loop before. As you said, many tutorials and JS Conf Talks helped me understand the concept better.
But to me, the amazing analogy that you used and your awesome explanation, was the simplest one so far.
Thank you so much, man!
I think you have the best videos on Javascript period. You take basic concepts and turn them into advanced concepts, yet I still understand what you are saying. You are a great teacher. Well done. Your "Introduction to Javascript for Developers" series is my most favorite Javascript series on RUclips. Very well done. Permanent bookmark:-)
Sir, please post more videos on Nodejs series.
This video has been incredibly helpful to simplify understanding of how event loops and call back works in JavaScript
Thank you so much! This video is perfect. I've finally figured out what event loop Is!
Is it just a coincidence that when I was learning java and spring koushik was also into it, and I'm now learning javascript, he's also doing the same :)
Yup, definitely stalking your learning path. Too bad you caught me! :)
@@Java.Brains hah But seriously, you've helped me a lot, and many others ofcourse. I found out the java road map video to be very helpful. If you could bring a similar sort of video for javascript, it would be really helpful.
Great visual video easily explaining management of synchronous and asynchronous logic. Thanks
OMG. I never thought the eventloop could be so easy to teach. Awesome.
thans, man. an ellegant explanation!
amazing explanation. thanks.
For the first time I saw how someone was able to explain the event loop with some kind of analogy from real life, I think this is what a lot of people on RUclips lack, thank you very much for your efforts!
sometimes the best explanations need to be in human terms 😅
Great, simple, clearly explained. Thanks mate.
Thanks, sir. However, I still have a question. For example, in my restaurant, 100 customers arrive simultaneously and they all want to order food. As you mentioned, we only have 1 waiter (thread). In this scenario, all customers will shout out, complain, and might not return to my restaurant next time.
Really missed you Kausik please please make videos frequently , I always eagerly waiting for your video they are always best as compared to other RUclips videos
tons of one hour duration videos about event loop, beautiful presentations jokes and no concrete info, why there is not videos like this. short and clear
The only video, that taught me something on this topic..thank you very much
Is that "while isNotEmpty(eventQueue)" loop running in the same thread or some JS engine level separate dedicated thread whose job is only to keep checking the eventQueue?
Great Video! Appreciate your effort. Thanks, Koushik!
Following you since 2012 ... when i was start to learn JSP,Hibernate stuff. Thank bro
Hi Kaushik
I could not find complete javascript course on Java brains website.
I was looking to purchase it but its not there now.
I wanted to purchase it because of two reasons
1. I have purchased hundreds of courses around programming on several platforms, but your courses are at the top when it comes to quality.
2. I wanted to purchase as a token of appreciation for all your hard work.
Please guide where can I purchase complete javascript course.
Awesome as always!! Thanks Sir. Keep enlightening us. God bless you with good health and all the happiness in the world! :)
6:49 is there a typo?
Shouldn't it be chef.handOver(order1, ... ) ?
either way, great video! :))
The best analogy to explain event loop. Thanks a lot
Extraordinary you are really cool it's very useful to understand easily thank you so much 👌🏼👌🏼
Event loop is a loop that are checking calstack continuously. if call stack is empty it push event that are waiting in event queue into the call stack for exicution perpose.
sadly you didn't explain what the chef in your example is exactly and WHY Javascript is able to go one without waiting for the task to finish. you didn't mention the web api. a little bit disappointed
I have to get json api data get every 2 second and make chart as per the json data. What should I use to 2 second get refreshed data of json. And this will be 24*7.
Definitely cleared all my doubts , sooo mooth of a tutorial. Bang on Example. Thanks a lot !
But still a doubt, the call backes which are kept in event queue are getting executed synchronously or they are executed by some thread?
I have to pause the video and give the positive comment. It is brilliant. Thanks for your effort.
This is my first comment for a tech video, this was neat and clear . very good job! really appreciate your work.
I dont wanna swear but This was fucking awesome bro TY
hey guy, im from brazil and i really apreciate your work, congratulations
Your approach to explained the concept of event loop was superb. Thank you.
Brilliant, simple explanation. Thank you!
who is the chef in JS that the waiter handovers the task to? Like waiter is the single execution thread you mentioned and who is the chef refers to in JS
thank you very much i have watched many resource and got so confused...this cleared all my doubt
i heard that the callback in the que get pushed to the stack, only after the stack is empty, but does a stack ever get empty?
If JS is single threaded, how can the waiter and chef work at the same time?
Can someone clear this up. Thanks
Hi Kaushik, great content and explanation as always. Could you also please explain macrotasks and microtasks as well? I've gone through some documentation on the same, but as you mentioned, they seems to be more complicated explanations.
Why noone talks about micro and macro task?
am I right that callback functions should be as ligher as possible?
Just Wow!! This is the best way to learn event loop. Thank you so much
What will execute the chef's order aka callback function?
Thank you sir, awesome explanation!
This video probe that the explanation is a Art that just a few ones domain.
This is the best explanation of the event queue and loop. I learned a lot from your videos. Thanks for putting together these great videos 🙏🏻
Thank you for simple explanation it saved a lot of time for me.
a million thank you's for such a perfect explanation man
Most Clear explanation. Learned a lot from this video.
@Java Brains How do you do the animations ?
Thankyou for this video, it is very helpful. 💯
This one is the best explanation I have ever seen. Thank you.
so event loop and callstack are the same things right?
Amazing analogy.. straightforward!!!
And that was the best video who explained the Event Loop
If main thread is occupied with heavy calculative task, then who's putting button click events in event queue?
Remember - it's a single application thread. Other runtime concerns like queuing events, call stacks, memory management etc is managed by the runtime and does not involve the application thread.
@@Java.Brains i think this reply explains all the doubts i had regarding event loops. Thank you and god bless you for your tutorials :)
Amazing.... man I was really confused with this concept bt u know what this video completely cleared my doubt queue :)
Thanks for such informative video..
Please make videos on socket.io in node js.
Agreed. I feel like socket.io doesn't get the attention it deserves. I usually struggle to find dynamic and diverse content on its use in production environments. Sadly the last release of socket.io on NPM was a year ago, so that doesn't help things :(.
Thanks alot sir ♥️ best video on this topic on yt
I really liked “the waiter - restaurant” analogy to explain the event loop concept. Thanks!
I cannot thank you enough for this explanation
I love the animation as well as the poor waiter.😍
What an amazing video. Great analogy and perfect delivery of explanation. Beauty!
i loved this video, i finally understand!!
I like the drawings you do.
I gave you 2 likes, thanks!
Thank you this was a great video
Thank you legend 🙏🏼🙏🏼❤️❤️
Fantastic explanation, many thanks)
wowowowow!! thanks for making this vdo
thanks dude that was a great explanation
Thank you so much for making this video, I'm grateful for the fact that the quantity of event loop tutorial videos on RUclips didn't stop you from making this video.
Totally loved the way you explained Event Loop. Straight away subscribing :D
This is a Master piece of explanation
Hi Sir, Just to clarify.. suppose I have three functions in a js file. Will all three of them will be placed in event queue? If no, then how come setimeout places the function in event queue?
Very nice and understandable tutorial
very very very .....................................nice
Koushik you are awesome ..The Best on youtube ..thank you and apreciate a lot for such amazing detailed conceptual videos..COULD YOU PLEASE DO A SERIES ON DATA STRUCTURES BOTH CONCEPTS AND IMPLEMENTATION IN JAVASCRIPT ..would be very grateful..Ty
Great explanation 🎉, thanks ✅
Your explain in simplest form pls make more video on JavaScript ES6 and Callback .. appreciate your efforts
Hi kousik, addEventListener() is asynchronous,but you mention it as synchronous ?
Wonderful video, simple and straight forward. The best way to acquire new knowledge!
ooh bro u deserve more and more
You have just explained this topic in 5 mins. Salute for you.... Lots of love and respect
most underrated coding channel
Great fan of your video. Learn almost everything productive from your channel.please also make video on kubernates and docker.
thank you! now is clear
Brilliant and clear explanation! Thanks for making this video!