Amazing content Akshay :-) Have some quick questions: 1) When does the event loop actually start ? Are only asynchronous web api callbacks are registered in web api environment ? Does the web api environment stores only the callback function and pushes the same callback to queue/microtask queue? How does it matter if we delay for setTimeout would be 0ms. Then callback will move to queue without any wait ?
Wow, these are some of the best doubts. ❤️ 1. When does the event loop actually start? - Event loop, as the name suggests, is a single-thread, loop that is `almost infinite`. It's always running and doing its job. ❤️ 2. Are only asynchronous web API callbacks are registered in the web API environment? - YES, the synchronous callback functions like what we pass inside map, filter, and reduce aren't registered in the Web API environment. It's just those async callback functions that go through all this. 3. Does the web API environment stores only the callback function and pushes the same callback to queue/microtask queue? - Yes, the callback functions are stored, and a reference is scheduled in the queues. Moreover, in the case of event listeners(for example click handlers), the original callbacks stay in the web API environment forever, that's why it's advised to explicitly remove the listeners when not in use so that the garbage collector does its job. 4. How does it matter if we delay for setTimeout would be 0ms. Then callback will move to queue without any wait? No, there are trust issues with setTimeout() 😅. The callback function needs to wait until the Call Stack is empty. So the 0 ms callback might have to wait for 100ms also if the stack is busy. It's a very beautiful concept, and I've covered this in detail in the next episode of Namaste JavaScript. 🔥 Thank you so much for asking all these questions, Shruti. You're a gem. 💎
Answering your last question - How does it matter if we delay for setTimeout would be 0ms. Then callback will move to queue without any wait ? YES, If delay for setTimeout is 0 ms, a callback will be registered with 0 ms timeout and will immediately be pushed into the callback queue. However, the event loop will only move it to the JS call stack after it becomes empty. Hence, you can use setTimeout with 0ms wait time to defer a callback execution.
Cracked 2 interviews back to back and answered Event Loop quest in such a way that there were no cross question left for interviewers to ask. Thanks again Akshay
A good teacher with quality content doesn't needs a marketing and advertisement. Ppl fallback with him naturally. Thanks Akshay for being a good teacher😊
Thank you so much for watching the video, that too on a Sunday 😅 With so many distractions around, when you can take out time to learn something, then I can also take out time to teach something. ❤️ A teacher is nothing without students, we all make it happen together. Cheers to all of us. 😇
Content Which is not his... all he does is watch a 6year old video and copy everything.... and present his face, just for sake of making money or maybe trying to get a reputation yata yata... You seriously believe that hi spends his time learning stuff. No, he doesn't, he just watches the video copy the captions and changes the grammar, and puts all his time Into video editing.....I am telling you just in case you don't go blind and instead explore this field from the real developers.
@@harpicandparle-g5675 Content is present everywhere and everything is just a google search away. But the way and the manner in which it is presented such that it is understandable to everyone of all skill levels is what that matters. If u don't want to watch his videos that's fine and totally understandable. But don't demean and curse his efforts and his initiatives to make JS interesting. You won't find easy to understand high quality videos such as this digging deep into JS that too for free anywhere on youtube or similar platforms. Hence don't degrade and insult anyone's efforts, if u like it watch or else don't watch.
In JavaScript, the event loop, microtask queue, callback queue, and call stack are all key components that help manage the asynchronous nature of the language. Call Stack: The call stack is a data structure that keeps track of the function calls in your code. It follows the Last In, First Out (LIFO) principle, meaning the last function that gets pushed onto the stack is the first one to be popped off when the function completes. Callback Queue (Task Queue): The callback queue, also known as the task queue, holds tasks (callbacks or events) that are ready to be executed. These tasks usually come from asynchronous operations, such as DOM events, HTTP requests, or timers. Event Loop: The event loop is responsible for continuously checking the call stack and the callback queue. If the call stack is empty, the event loop takes the first task from the callback queue and pushes it onto the call stack for execution. Microtask Queue: The microtask queue holds tasks that are also ready to be executed but has a higher priority than the callback queue. Microtasks are usually scheduled by JavaScript promises, mutation observers, and other similar mechanisms. Here's how they work together: When an asynchronous operation is encountered, such as a setTimeout or a Promise, the callback associated with that operation is sent to the callback queue after the specified time or when the Promise settles. When the call stack is empty (no functions being executed), the event loop takes the first task from the microtask queue and pushes it onto the call stack. If the microtask queue is empty, the event loop looks at the callback queue and pushes the first task onto the call stack. This process repeats, allowing JavaScript to handle asynchronous operations without blocking the main thread. Understanding these concepts is crucial for writing efficient and responsive asynchronous JavaScript code, as it helps you manage the order of execution and prevent blocking the user interface.
After almost two years, here I am again, experiencing the same exhilarating rush of emotions just like the very first time. It's truly amazing to journey through this entire session once more.
#gajab(virtual hug emoji , searched specially for this video only.) watched in one go at 2Am, initially thought to skip bcz of length. but while watching got excited and completed without any pause. you will get to know about following terminology, callstack global execution context event loop Web APIs (e.g. setTimeout , DOMs , fetch, console) context callback queue(or task queue) microtask queue promises , mutation observer startvation of callback all the things are explained with three examples : setTimeout, dom apis with click event , fetch api + setTimeout. Great video, I can confidently say that this guy has not learned the conecpt in this deep bcz of simply working in company. Its because of his great interest/passion for Javascript. keep empowering us with such a great knowledge. I don't comment or like generally, but on this video have commented & liked both.
I have never seen anyone teaching concepts with so much depth, clarity and ease. The content is unbeatable, the delivery enthusiastic and love how eager you are to make JS easy for everyone. Thank you for putting all this effort and coming up with this series. Worth every second of watch time.
hello as a codeNewbie i just want to ask you something . Ive started web development and rn im doing js , so how to get to know that what total number of concepts are needed for mastering javascript .. and suggestions for web development will be much more apreciated
Great video, Akshay! I appreciate the way you break things down and that you take the time to reiterate even the simpler concepts. You have the heart of a teacher, and we could not be more grateful.
Things learned: 1. Browser has superpowers that are lent to JS engine to execute some tasks, these superpowers include web API's such as console, location, DOM API, setTimeout, fetch, local storage. 2. Callback functions and event handers are first stored in Web API environment and then transferred to callback queue. 3. Promises and mutation observer are stored in API environment and then transferred to microtask queue. 4. Event loop continuously observes call stack and when it is empty it transfers task to call stack. 5. Micro task is given priority over callback tasks. 6. Too many micro tasks generated can cause Starvation (nit giving time to callback tasks to execute).
Small correction only asynchronous callback functions are stored in the web api's env. There are some synchronous callback functions which are not stored like map,filter,reduce
Best thing is that He himself requests us to stay for some more time to learn. In clg, even if we request, teachers weren't explaining clearly. Akshay "ದೇವರು ಒಳ್ಳೇದು ಮಾಡಲಿ🙌"
This is probably the only course that does not bore me. I feel like going through one more episode even when I'm done for the day. You make concepts very easy to understand. Thank you for this series, Akshay.
I am a student .I started learning JavaScript 3 months back .I am very passionate to know how actually JS works behind the scene. For me this NamasteJS series is like dream came true
At first, I clicked on your video to clarify my concepts on hoisting. However, I ended up watching the entire series for multiple times. It is surprising how you can have such a thorough understanding of JavaScript, and such in-depth explanation of all the concepts, both theoretically and practically. Love your passion, thank you so much!
I recently interviewed a candidate for a FEE role and when I asked him about Web APIs, he said, 'It's a browser superpower', I was bloody confused, only now I know.
I usually don't comment as you pointed out, but this video being so comprehensive and detailed yet so simple to understand made me comment here. The explanation was too good and anyone could easily understand them. I highly recommend going through this series serially as that will help you understand every concept deeply and get your foundations strong. Thank you Akshay for making this series public as this will help new developers (and experienced too) to not just code to finish work on deadline but will also make them fall in love with this beautiful language.
I am a java developer. Before watching this series I really used to hate JavaScript because it really behaves differently than other programming languages . I have watched a lot of tutorial series of JS but, your content is PURE GOLD! As you said at the start of this series, your GOAL is to make people fall in love with JS. I think you have succeeded. ♥️
Current job market had been depressing and I recently joined Bytedance! In my final tech round, I was asked JS Event Loop, Prototype chaining, promises etc. I immediately thanked you when I saw the smile on the interviewer's face after I answered all of them correctly. He then asked me to code JSON Deep clone and it went super smooth. Grateful for the lessons. I also happen to have graduated from MUJ.!
The Event Loop pushes the "queue" into the Call Stack only when the Call Stack is empty (i.e. the global execution context has been pushed off the call stack). The order in which the Event Loop works is: 1. Call Stack 2. Microtask Queue 3. Callback Queue Hope this helps :)
Wow, this is gold. There's no other content about event loop as good as this on the whole TH-cam. This is the simplest and most effective way of teaching what event loop is. Thank you Akshay for the content.
hello as a codeNewbie i just want to ask you something . Ive started web development and rn im doing js , so how to get to know that what total number of concepts are needed for mastering javascript .. and suggestions for web development will be much more apreciated
Watching the Namaste JavaScript videos in order has been incredibly enlightening. I wish I knew all this when I started JS a few years ago. This video was all new to me and wonderfully explained. Thank you for such a valuable resource!
my brother recommended this channel for javaScript to me. I thought this man will teach as others are teaching on youTube but No I was wrong ,this man is such a legend ,after completing this playlist and season 2 will also be continued now i am going to watch his namste react course which was recommended by me . thank you so much Akshay bhaiya💌🙏🙏 ,you are amazing 👌👌.
The last 6 years of my life would have been a lot easier if I would have got such a thing during my college days. Content and this is awesome. Big clap
hello as a codeNewbie i just want to ask you something . Ive started web development and rn im doing js , so how to get to know that what total number of concepts are needed for mastering javascript .. and suggestions for web development will be much more apreciated
@@harshneetsingh5267 This namaste js playlist is enough but i would suggest if your goal is web dev first understand what you want to become be it MERN developer or simple react frontend developer based on that learn the subsequent technologies and create projects while acquiring the knowledge.
No wonder why I agreed to my strong urge of disabling the ad block for your channel. Such an amazing content and that too for free seemed like far fetched dream. 😍
With this understanding of the event loop, I feel like I can nail an interview. Nicely Explained. I always find your videos simple and full of knowledge.
@@vikramweb5369 Yes, there is a difference between lexical scope and lexical environment in JavaScript. Lexical Scope: Lexical scope refers to the scope of variables in JavaScript based on the location of their declaration in the source code. Lexical Environment: A lexical environment is an internal data structure used by JavaScript engines to keep track of variables, function declarations, and their scopes during the runtime of a program. Hope you got the point
OMG! The more I get deeper into event loop, I am feeling I need to dig deeper. This is mind blowing explanation and details. I liked the neon effects of the sketches you draw while explaining. Thank you so much for putting extreme efforts in making this video and sharing the knowledge. I would like to know now about event loop in node.js and particularly phases of event loop in node.js. :)
hello as a codeNewbie i just want to ask you something . Ive started web development and rn im doing js , so how to get to know that what total number of concepts are needed for mastering javascript .. and suggestions for web development will be much more apreciated
Fun Fact: In most of the browsers, there is an event loop for each browser tab this makes every process isolated and avoid a webpage with infinite loops and heavy processing to freeze the entire browser 🚀
@@dgdivyanshugupta Chrome creates a process for each tab you open with a website, so suppose you opened 10 tabs with 10 sites this will create 10 separate processes which causes a high RAM usage in chrome, but in other browsers like firefox a default of 4 processes are created. So, your first 4 tabs each use those 4 processes, and additional tabs run using threads within those processes. Multiple tabs within a process share the browser engine that already exists in memory, instead of each creating their own.
This is awesome never seen this kind of one's expecting more like this deep drive understanding the javascript, I really enjoyed with this video really great sir 🎉🎉
A good teacher with quality content doesn't needs a marketing and advertisement. Ppl fallback with him naturally. Thanks Akshay sir for being a good teacher
almost 2.5 year back, i crossed path with one of your namaste js video, after watching it for few minutes i got aware of that i am not ready for this level of content but in my mind i registered a promise that one day i will come back when i will be well versed with basic js and trust me i have hustled alot with js and when the right would come start this series, finally i was able to start watching this series and currently just finished this one. extremely Thankful to you as well as to me finally i am about to resolve my promise and soon my own promise will going to move to microTask queue and then to call stack. THANK YOU ❤❤
You should not thank us for watching your video. We should thank you for making this amazing. I don't comment on any videos, but i comment on all videos of yours. Thank you so much for teaching this good :)
Yes, I covered everything from scratch. It took a lot of time to make this video. Please watch it with attention, each and every example which I cover. ❤️
Amazing video ! Mind blowing content. Now the time has come when the best of the best content is available for free. Education is no more dependent on money. Thanks for the whole series. I am doing my BCA (first year) and learning web dev on my own, this series is helping me a lot, clearing the core fundamentals like how things actually work. Eagerly waiting for "promises" episode !!
Interviewer : What is web APIs ? Me : Superpowers Interviewer: What ? I think you were watching marvel movies just before the interview, is it ? Me : No, I was watching Akshay Saini on youtube. You are great bro...!!! Industry needs more teachers like you. Please keep up teaching us.
hello as a codeNewbie i just want to ask you something . Ive started web development and rn im doing js , so how to get to know that what total number of concepts are needed for mastering javascript .. and suggestions for web development will be much more apreciated
@@harshneetsingh5267 JS is very vast in itself 🤣 I have 5+ yrs of exp, still running for JS concepts. Good things take time my friend 😊 Just Keep watching Akshay Sir's videos from the beginning but don't stop exploring JS on your own. Thanks!
First glance: I saw caption Event loop.. Second glance: I saw the video length 42 minutes😃!! Waise to I know Async Event loop...but Bhai ne 42mint dala hai to deep gaya hoga For Suree!! Liked the video before watching...and very excited to sit alone and dive deep!! Thanks Akshay Bhaaauuuu 🤟🏼
Usually, I don't prefer commenting on videos. but here I am ...to tell you buddy that you are amazing. the way you teach is besssstttt. and your smile is good be happy brother.
Amazing in depth explanation brother. The one thing everyone miss is the intricate visualualisation of deep concepts and you have done it so beautifully. Really enjoyed the video. Waiting for another such valuable content. Cheers!
Haha, yeah it took a lot of time to plan those intricate visualizations in my head and then execute it. I'm actually still learning to teach without making things boring. 😇 Thank you so much for your comment, means a lot. ✌🏽
Watch `Maha-Episode` of this series: JS ENGINE Architecture 🔥 - th-cam.com/video/2WJL19wDH68/w-d-xo.html How was this video? Let me know in the comments below, I read each and every comment! ❤️
since 3months i am working javascript i don't about this concept when I watch the video I got lot of knowledge and I can understand easily and I got some confident also thank so much akshay you are very good teacher in my life , I don't forgot you in my life.
Mind: "I will watch for 5 minutes and watch it later " Video: "nope you're gonna finish the entire video" The power of Akshay's videos 👏👏👏👏 Thank you man.
How can call back access global execution context or scope chain variables when global execution contest is removed from the call stack due to the wait period of call back set timeout function.
Because of Closures. Though GEC is removed, the reference to the memory stays with the function because of Closures. I've explained this in the Closures and Callbacks videos. Please watch them before this one. Everything is related, brother. ❤️
@@akshaymarch7 thanks so we can assume that every function makes closure weather it is call back or static or private. Or are there any restrictions to avoid closure to a function .
This is probably the only course which does not bore me. I feel like going through one more episode even when I'm done for the day. You make concepts very easy to understand. Thank you for this series Akshay.
Amazing content Akshay :-) Have some quick questions: 1) When does the event loop actually start ? Are only asynchronous web api callbacks are registered in web api environment ? Does the web api environment stores only the callback function and pushes the same callback to queue/microtask queue? How does it matter if we delay for setTimeout would be 0ms. Then callback will move to queue without any wait ?
Wow, these are some of the best doubts. ❤️
1. When does the event loop actually start? - Event loop, as the name suggests, is a single-thread, loop that is `almost infinite`. It's always running and doing its job. ❤️
2. Are only asynchronous web API callbacks are registered in the web API environment? - YES, the synchronous callback functions like what we pass inside map, filter, and reduce aren't registered in the Web API environment. It's just those async callback functions that go through all this.
3. Does the web API environment stores only the callback function and pushes the same callback to queue/microtask queue? - Yes, the callback functions are stored, and a reference is scheduled in the queues. Moreover, in the case of event listeners(for example click handlers), the original callbacks stay in the web API environment forever, that's why it's advised to explicitly remove the listeners when not in use so that the garbage collector does its job.
4. How does it matter if we delay for setTimeout would be 0ms. Then callback will move to queue without any wait?
No, there are trust issues with setTimeout() 😅. The callback function needs to wait until the Call Stack is empty. So the 0 ms callback might have to wait for 100ms also if the stack is busy. It's a very beautiful concept, and I've covered this in detail in the next episode of Namaste JavaScript. 🔥
Thank you so much for asking all these questions, Shruti. You're a gem. 💎
@@akshaymarch7 Thanks a lot :-)
Answering your last question - How does it matter if we delay for setTimeout would be 0ms. Then callback will move to queue without any wait ?
YES, If delay for setTimeout is 0 ms, a callback will be registered with 0 ms timeout and will immediately be pushed into the callback queue. However, the event loop will only move it to the JS call stack after it becomes empty. Hence, you can use setTimeout with 0ms wait time to defer a callback execution.
@@akshaymarch7 today i realised i also should read comments. There is also lots of things to learn. ❤️❤️
Javascript is sychnrous or asynchrouns
Cracked 2 interviews back to back and answered Event Loop quest in such a way that there were no cross question left for interviewers to ask. Thanks again Akshay
Can you give some examples of the questions asked? Will help others to check their understanding as well
Yes, plzz comment your questions which are asked for you .It would be greatly helpful
@@dgdivyanshugupta Event loop explanation, promises(which i studied on my own) . How async works, similar questions
@@rhimanshu6288 bro which company did u attend?
Where did u got placed
A good teacher with quality content doesn't needs a marketing and advertisement. Ppl fallback with him naturally. Thanks Akshay for being a good teacher😊
Thank you so much for watching the video, that too on a Sunday 😅
With so many distractions around, when you can take out time to learn something, then I can also take out time to teach something. ❤️
A teacher is nothing without students, we all make it happen together.
Cheers to all of us. 😇
@@akshaymarch7 Ek hi dil h yaaar kitni baar jeetoge
Content Which is not his... all he does is watch a 6year old video and copy everything.... and present his face, just for sake of making money or maybe trying to get a reputation yata yata... You seriously believe that hi spends his time learning stuff. No, he doesn't, he just watches the video copy the captions and changes the grammar, and puts all his time Into video editing.....I am telling you just in case you don't go blind and instead explore this field from the real developers.
@@harpicandparle-g5675 Content is present everywhere and everything is just a google search away. But the way and the manner in which it is presented such that it is understandable to everyone of all skill levels is what that matters. If u don't want to watch his videos that's fine and totally understandable. But don't demean and curse his efforts and his initiatives to make JS interesting. You won't find easy to understand high quality videos such as this digging deep into JS that too for free anywhere on youtube or similar platforms. Hence don't degrade and insult anyone's efforts, if u like it watch or else don't watch.
@@prashanthvamanan1513 absolutely bro
In JavaScript, the event loop, microtask queue, callback queue, and call stack are all key components that help manage the asynchronous nature of the language.
Call Stack:
The call stack is a data structure that keeps track of the function calls in your code. It follows the Last In, First Out (LIFO) principle, meaning the last function that gets pushed onto the stack is the first one to be popped off when the function completes.
Callback Queue (Task Queue):
The callback queue, also known as the task queue, holds tasks (callbacks or events) that are ready to be executed. These tasks usually come from asynchronous operations, such as DOM events, HTTP requests, or timers.
Event Loop:
The event loop is responsible for continuously checking the call stack and the callback queue. If the call stack is empty, the event loop takes the first task from the callback queue and pushes it onto the call stack for execution.
Microtask Queue:
The microtask queue holds tasks that are also ready to be executed but has a higher priority than the callback queue. Microtasks are usually scheduled by JavaScript promises, mutation observers, and other similar mechanisms.
Here's how they work together:
When an asynchronous operation is encountered, such as a setTimeout or a Promise, the callback associated with that operation is sent to the callback queue after the specified time or when the Promise settles.
When the call stack is empty (no functions being executed), the event loop takes the first task from the microtask queue and pushes it onto the call stack.
If the microtask queue is empty, the event loop looks at the callback queue and pushes the first task onto the call stack.
This process repeats, allowing JavaScript to handle asynchronous operations without blocking the main thread.
Understanding these concepts is crucial for writing efficient and responsive asynchronous JavaScript code, as it helps you manage the order of execution and prevent blocking the user interface.
Well efforts brother
you have written so well. Great.👍
Superb...
41:45
ChatGPT response
After almost two years, here I am again, experiencing the same exhilarating rush of emotions just like the very first time. It's truly amazing to journey through this entire session once more.
#gajab(virtual hug emoji , searched specially for this video only.)
watched in one go at 2Am, initially thought to skip bcz of length. but while watching got excited and completed without any pause.
you will get to know about following terminology,
callstack
global execution context
event loop
Web APIs (e.g. setTimeout , DOMs , fetch, console) context
callback queue(or task queue)
microtask queue
promises , mutation observer
startvation of callback
all the things are explained with three examples : setTimeout, dom apis with click event , fetch api + setTimeout.
Great video, I can confidently say that this guy has not learned the conecpt in this deep bcz of simply working in company.
Its because of his great interest/passion for Javascript.
keep empowering us with such a great knowledge.
I don't comment or like generally, but on this video have commented & liked both.
Forget everything, just admire the way he is doing everything so that we can understand everything. The guy isn't backing off for one single moment.
I have never seen anyone teaching concepts with so much depth, clarity and ease. The content is unbeatable, the delivery enthusiastic and love how eager you are to make JS easy for everyone. Thank you for putting all this effort and coming up with this series. Worth every second of watch time.
hello as a codeNewbie i just want to ask you something . Ive started web development and rn im doing js , so how to get to know that what total number of concepts are needed for mastering javascript .. and suggestions for web development will be much more apreciated
have you get your answer ,,,,batao yaar,,,,,im in same situation that you in last year,,,@@harshneetsingh5267 🙂
Great video, Akshay! I appreciate the way you break things down and that you take the time to reiterate even the simpler concepts. You have the heart of a teacher, and we could not be more grateful.
Things learned:
1. Browser has superpowers that are lent to JS engine to execute some tasks, these superpowers include web API's such as console, location, DOM API, setTimeout, fetch, local storage.
2. Callback functions and event handers are first stored in Web API environment and then transferred to callback queue.
3. Promises and mutation observer are stored in API environment and then transferred to microtask queue.
4. Event loop continuously observes call stack and when it is empty it transfers task to call stack.
5. Micro task is given priority over callback tasks.
6. Too many micro tasks generated can cause Starvation (nit giving time to callback tasks to execute).
Yesss. Thanks for writing this!
Small correction only asynchronous callback functions are stored in the web api's env. There are some synchronous callback functions which are not stored like map,filter,reduce
@@VikasKumar-zw7ko then where the synchronous callback function is store
They get executed immediately i guess ?
In addition JS engine only handles callback stack
Browser need to handle web API, microtask queue, callback queue
This is the best JS tutorial I've seen on the internet. It is quality than a paid course. Thank you Akshay!!!.
Best thing is that He himself requests us to stay for some more time to learn.
In clg, even if we request, teachers weren't explaining clearly.
Akshay "ದೇವರು ಒಳ್ಳೇದು ಮಾಡಲಿ🙌"
ಧನ್ಯವಾದಗಳು, Santhosh ❤️
This is probably the only course that does not bore me. I feel like going through one more episode even when I'm done for the day. You make concepts very easy to understand. Thank you for this series, Akshay.
I cannot stop watching "Namaste Javascript". As a beginner, I am quickly able to grasp so many new terms and explanations. Hats Off Man!
You finish this playlist?
I am a student .I started learning JavaScript 3 months back .I am very passionate to know how actually JS works behind the scene. For me this NamasteJS series is like dream came true
At first, I clicked on your video to clarify my concepts on hoisting. However, I ended up watching the entire series for multiple times. It is surprising how you can have such a thorough understanding of JavaScript, and such in-depth explanation of all the concepts, both theoretically and practically. Love your passion, thank you so much!
I recently interviewed a candidate for a FEE role and when I asked him about Web APIs, he said, 'It's a browser superpower', I was bloody confused, only now I know.
OMG 😂
@@akshaymarch7 Great content, man. To see the number of people learning and benefiting from them is the true measure of your success as a teacher.
haha
😂😂😂
Must b Akshy Saini student. 😂😂
I usually don't comment as you pointed out, but this video being so comprehensive and detailed yet so simple to understand made me comment here. The explanation was too good and anyone could easily understand them. I highly recommend going through this series serially as that will help you understand every concept deeply and get your foundations strong. Thank you Akshay for making this series public as this will help new developers (and experienced too) to not just code to finish work on deadline but will also make them fall in love with this beautiful language.
I am a java developer. Before watching this series I really used to hate JavaScript because it really behaves differently than other programming languages . I have watched a lot of tutorial series of JS but, your content is PURE GOLD! As you said at the start of this series, your GOAL is to make people fall in love with JS. I think you have succeeded. ♥️
Current job market had been depressing and I recently joined Bytedance! In my final tech round, I was asked JS Event Loop, Prototype chaining, promises etc. I immediately thanked you when I saw the smile on the interviewer's face after I answered all of them correctly. He then asked me to code JSON Deep clone and it went super smooth. Grateful for the lessons. I also happen to have graduated from MUJ.!
Thank you so much for supporting our channel. This means a lot. ♥️
Bro aapne collage kb passout kia??
@@mathsejee3520 Engg was 2020. worked for 2 years and completed MS in 2023 december
This entire series is a must watch for any JS developer!
YES I MUST AGREE WITH YOU MY BOY
The Event Loop pushes the "queue" into the Call Stack only when the Call Stack is empty (i.e. the global execution context has been pushed off the call stack).
The order in which the Event Loop works is:
1. Call Stack
2. Microtask Queue
3. Callback Queue
Hope this helps :)
Question. Are callback and microtask queue part of js or browser??
I thing no
browser
@@thatintellectualguy
@@thatintellectualguy the call back function is part of javascript and the queue is part of browser like call stack has .
The best thing about his videos is you never get bored even if the video is 1hr long. Kudos to you brother!! Keep up the good work!!
At the end i felt like i have achieved knowledge of a whole book only on event loop. Really filing like master of event loop. Really thanks to you.
I feel like i have found a hidden treasure, amazing worth much more than the paid content. Thank you so much for such grate knowledge :)
This is not only a Js series, It's a masterpiece 💯
Wow, this is gold. There's no other content about event loop as good as this on the whole TH-cam. This is the simplest and most effective way of teaching what event loop is.
Thank you Akshay for the content.
Diamond u mean
shuru majboori me kiye the ,
Ab maja aa raha hai .
Event loop is one the most important concept for every JS interviews.
spent whole day studying about event loop and finally understood it in these 40 mins, Best explained.
hello as a codeNewbie i just want to ask you something . Ive started web development and rn im doing js , so how to get to know that what total number of concepts are needed for mastering javascript .. and suggestions for web development will be much more apreciated
Watching the Namaste JavaScript videos in order has been incredibly enlightening. I wish I knew all this when I started JS a few years ago. This video was all new to me and wonderfully explained. Thank you for such a valuable resource!
You are super amazing and I can promise after this I will never ever forget what an event loop is.
OMG!!! My interview is scheduled at 1PM today and I was dying for your next video....Big Thank You!!!!
All the best brother, aag laga dena 🔥
@@akshaymarch7 definitely Guruji !!
How was your interview? Share your interview experience.
@@vipingautam1400 Bro can you please share React Questions they asked. Thanks in Advance
@@akshaymarch7 After watching your videos we feel more confident Aag 🔥🔥🔥🔥to lagana hi hai...
This " Namaste javascript " feels like the recursion of pure quality content... Just waiting for your next videos...thanks brother🔥🔥
Wow, thank you for such a lovely comment! 😇
my brother recommended this channel for javaScript to me. I thought this man will teach as others are teaching on youTube but No I was wrong ,this man is such a legend ,after completing this playlist and season 2 will also be continued now i am going to watch his namste react course which was recommended by me .
thank you so much Akshay bhaiya💌🙏🙏 ,you are amazing 👌👌.
The last 6 years of my life would have been a lot easier if I would have got such a thing during my college days. Content and this is awesome. Big clap
today same thought came in my mind at the time of watching video
You make everything sound so simple. This is the best playlist I've encountered. I am really enjoying namaste JavaScript. Great work Akshay 👍
hello as a codeNewbie i just want to ask you something . Ive started web development and rn im doing js , so how to get to know that what total number of concepts are needed for mastering javascript .. and suggestions for web development will be much more apreciated
@@harshneetsingh5267 This namaste js playlist is enough but i would suggest if your goal is web dev first understand what you want to become be it MERN developer or simple react frontend developer based on that learn the subsequent technologies and create projects while acquiring the knowledge.
@@codeRajeshPal I want to be full stack so . I’m going for front end first
@@codeRajeshPal do u know any channels similar to this in explanation for React js..?
functions are heart of JavaScript and JavaScript is heart of akshay 😂😂🔥🔥🔥brother thank you so much 💓💓
No wonder why I agreed to my strong urge of disabling the ad block for your channel. Such an amazing content and that too for free seemed like far fetched dream. 😍
♥️
With this understanding of the event loop, I feel like I can nail an interview. Nicely Explained. I always find your videos simple and full of knowledge.
We need more teachers like him! This man is literally the best!🌻
is there any difference between lexical scope and lexical environment.
@@vikramweb5369 Yes, there is a difference between lexical scope and lexical environment in JavaScript.
Lexical Scope:
Lexical scope refers to the scope of variables in JavaScript based on the location of their declaration in the source code.
Lexical Environment:
A lexical environment is an internal data structure used by JavaScript engines to keep track of variables, function declarations, and their scopes during the runtime of a program.
Hope you got the point
Won't get such a simplified explanation for this concept anywhere else...
Thanks Akshay Sir
OMG! The more I get deeper into event loop, I am feeling I need to dig deeper. This is mind blowing explanation and details. I liked the neon effects of the sketches you draw while explaining. Thank you so much for putting extreme efforts in making this video and sharing the knowledge. I would like to know now about event loop in node.js and particularly phases of event loop in node.js. :)
hello as a codeNewbie i just want to ask you something . Ive started web development and rn im doing js , so how to get to know that what total number of concepts are needed for mastering javascript .. and suggestions for web development will be much more apreciated
I don't usually write comments on TH-cam tutorials, but the content of this guy forced me to do so. More power to you ❤🔥❤🔥
Akshay Kumar's dialogue "I no study IIT, but IIT study me" suits you bro🤗
You are great man. I love those teachers who really enjoy teaching ❤️
Love and Respect from Bangladesh 🇧🇩
Your explanation is so so simple ,that even a 6 year old boy/girl can understand without any problem.🙏
I'm trying hard upon my teaching skills, this beautiful comment made my day!
Akshay you made so easy to understand. The way of explanation is feels like a story telling. Good job keep the hard work goes on. Cheers 👍👍
Man I can study with this guy for the whole day
No one can explain these type of content in youtube like you explain.
Understood indepth of event loop in a simpler crystal clear way .
Wow , bro you made this very easy for us to understand
Fun Fact: In most of the browsers, there is an event loop for each browser tab this makes every process isolated and avoid a webpage with infinite loops and heavy processing to freeze the entire browser 🚀
Thank you for sharing that. Then why is Chrome is said to be heavier than other browsers like Mozilla Firefox, safari,?
@@dgdivyanshugupta Chrome creates a process for each tab you open with a website, so suppose you opened 10 tabs with 10 sites this will create 10 separate processes which causes a high RAM usage in chrome, but in other browsers like firefox a default of 4 processes are created. So, your first 4 tabs each use those 4 processes, and additional tabs run using threads within those processes. Multiple tabs within a process share the browser engine that already exists in memory, instead of each creating their own.
@@pranjalagnihotri6072 if its true then good explaination bro...
@@ArjunSingh-oo1mh Yeap it is true bro..
Couldn't have asked for a better explanation than this. Kudos to you !
This is awesome never seen this kind of one's expecting more like this deep drive understanding the javascript, I really enjoyed with this video really great sir 🎉🎉
Loved this Akshay!! I literally had no idea so many things are going on behind the scenes and I've been working on JS for more than a year.
That happens, we generally don't know what happens behind just a sweet simple `console.log("helloworld")`. Glad you enjoyed it. ! 😇
Beautifully explained, I've never dived down as deep into JS as this before.
A good teacher with quality content doesn't needs a marketing and advertisement. Ppl fallback with him naturally. Thanks Akshay sir for being a good teacher
No one ever taught about this as clear as you do. Thank you so much Akshay.
This lecture was so interesting that I actually didn't blinked my eye.
Ps: your smile + laugh combination look interesting at 1.5x speed
Haha 😅
Namaste Javascript! 🙏 These video are like new discovery to me. I love it definitely . Thank you so much for your amazing videos.
almost 2.5 year back, i crossed path with one of your namaste js video, after watching it for few minutes i got aware of that i am not ready for this level of content but in my mind i registered a promise that one day i will come back when i will be well versed with basic js and trust me i have hustled alot with js and when the right would come start this series, finally i was able to start watching this series and currently just finished this one. extremely Thankful to you as well as to me finally i am about to resolve my promise and soon my own promise will going to move to microTask queue and then to call stack.
THANK YOU ❤❤
Good man
It didn't felt like I am studying anything...it felt like a beautiful story is going on. Thank you for your efforts, sir.
You should not thank us for watching your video. We should thank you for making this amazing. I don't comment on any videos, but i comment on all videos of yours. Thank you so much for teaching this good :)
Thank you ♥️
@@akshaymarch7 love you bro ❤️
"Good Teacher With Good Quality Content", No Comparison :)
I spend hours watching other youtube channels to learn JS This is the most valuable playlist to learn JS in depth thanks sir for ur efforts😊
It's Awesome 🤯.
You are Genius🦸♂️ guy .
Thank you❤️ so much for sharing this deep🧜 and Magical🧚 hidden world of JS.
Event loop is like a cupid between GEC and callback queue 😋
The 41 min video 🥳🥳🥳🥳🥳
I can imagine the amount of hardwork 😇
Yes, I covered everything from scratch. It took a lot of time to make this video.
Please watch it with attention, each and every example which I cover. ❤️
This course give me more energy when I started. because the way you teach is loved it. i can't say thankyou I say Dhanyawad namaste javascript
Great Efforts and best explanations ,Thanks is just not enough to be thankful for such a great content .
Amazing video ! Mind blowing content. Now the time has come when the best of the best content is available for free. Education is no more dependent on money. Thanks for the whole series. I am doing my BCA (first year) and learning web dev on my own, this series is helping me a lot, clearing the core fundamentals like how things actually work. Eagerly waiting for "promises" episode !!
Interviewer : What is web APIs ?
Me : Superpowers
Interviewer: What ? I think you were watching marvel movies just before the interview, is it ?
Me : No, I was watching Akshay Saini on youtube.
You are great bro...!!!
Industry needs more teachers like you. Please keep up teaching us.
Interviewer : What is web APIs ?
Me : *Web APIs connect JS Engine to the Superpowers of Browser.
hello as a codeNewbie i just want to ask you something . Ive started web development and rn im doing js , so how to get to know that what total number of concepts are needed for mastering javascript .. and suggestions for web development will be much more apreciated
@@harshneetsingh5267 JS is very vast in itself 🤣 I have 5+ yrs of exp, still running for JS concepts. Good things take time my friend 😊 Just Keep watching Akshay Sir's videos from the beginning but don't stop exploring JS on your own. Thanks!
Even those who built it cannot take a class like this. I have never seen a teacher like you 💝
♥️🥺
Thanks akshay, you are "JS baba"
First glance: I saw caption Event loop.. Second glance: I saw the video length 42 minutes😃!! Waise to I know Async Event loop...but Bhai ne 42mint dala hai to deep gaya hoga For Suree!! Liked the video before watching...and very excited to sit alone and dive deep!! Thanks Akshay Bhaaauuuu 🤟🏼
Yes, I tried to cover from scratch and covering most of the corner cases.
Thank you brother for your lovely comment. ❤️
SetTimeout is not part of Javascript: Heartbreaking. Something new I learned. Probably I forgot this part as in NodeJs it's built in.
node is built using the v8 engine which was developed for google chrome
Same lol
Your lecture is a gold mine..
Usually, I don't prefer commenting on videos.
but here I am ...to tell you buddy that you are amazing.
the way you teach is besssstttt.
and your smile is good be happy brother.
Amazing in depth explanation brother. The one thing everyone miss is the intricate visualualisation of deep concepts and you have done it so beautifully. Really enjoyed the video. Waiting for another such valuable content. Cheers!
Haha, yeah it took a lot of time to plan those intricate visualizations in my head and then execute it. I'm actually still learning to teach without making things boring. 😇
Thank you so much for your comment, means a lot. ✌🏽
Watch `Maha-Episode` of this series: JS ENGINE Architecture 🔥 - th-cam.com/video/2WJL19wDH68/w-d-xo.html
How was this video? Let me know in the comments below, I read each and every comment! ❤️
Excellent. Very useful. You are too good.
It's suprb 🥳🥳 Thanks bro for your time me and hardwork 😇😇
Bhai,killing it ! everytime
God of JavaScript....🔥🙏 Namaste bro...
@@JK92007 Hey, no man. Don't say that!! 😅
🔥🔥 Great Efforts as always ❤️❤️.
One doubt :
What do you call the browser space where CallBack functions are stored before CallBack Queue ?
You can call it as the, `Web API Environment` 🔥
@@akshaymarch7 thanks
@@akshaymarch7 Cool Thanks
Never thought Event loop would be that simple.
Hats off to you!!!
Call back queue is also called as message queue.
Me when my mom tries to wake me up: Just 5 more minutes (and boom it's afternoon)
Akshay Bhai: Give me just 5 more minutes (And boom Js is over 💥)
Haha 😂
I first click on "Thumbs Up" then start watching. 😀
I also
since 3months i am working javascript i don't about this concept when I watch the video I got lot of knowledge and I can understand easily and I got some confident also thank so much akshay you are very good teacher in my life , I don't forgot you in my life.
Mind: "I will watch for 5 minutes and watch it later "
Video: "nope you're gonna finish the entire video"
The power of Akshay's videos 👏👏👏👏
Thank you man.
lolll same with me
omg! Thats what just happened! with me too!
I never knew learning is so much fun.
If the Interviewer doesn't ask any Question from this topic i will scould him like anything
I am watching your videos in 2024..... it's mind-blowing stuff bro.... Excellent work .... Thank you for making such a wonderful videos.
How can call back access global execution context or scope chain variables when global execution contest is removed from the call stack due to the wait period of call back set timeout function.
I got the same doubt
I guess when moving call back function to web Api environment it also moves all of its lexical scope along with it
Because of Closures. Though GEC is removed, the reference to the memory stays with the function because of Closures.
I've explained this in the Closures and Callbacks videos. Please watch them before this one. Everything is related, brother. ❤️
@@akshaymarch7 thanks so we can assume that every function makes closure weather it is call back or static or private.
Or are there any restrictions to avoid closure to a function .
@@mohnishsatidasani7552 In JavaScript, closures are created every time a function is created, at function creation time.
The interviewer asked me to explain event loop and i explained to him deeply just like Akshay and now the interviewer is in Sleep mode.
😂😂 great
Interviewer came to take interview but got a tutorial..
Akshay: Just, 5 more minutes, give me 5 more minutes!!
Me: Dude, take my whole life. I'm enjoying the s**t out of this. 😂😂😂
This is for real the best playlist on JavaScript out there, so well explained and so in-depth, and also entertaining.
The one person who has disliked, can hack Nasa with Html 😂
Haha 😂
Let it be, likes and dislikes doesn't matter now. It's about how many people actually understood the concept properly! 😇
Hahaha.....Then there will be a another new thing to learn. 🤪
I Just Hope Our Gatekeeper #EventLoop Never Gets Drunk 🙂.
Thank You.
I know where you're coming from. Haha 😅
This is probably the only course which does not bore me. I feel like going through one more episode even when I'm done for the day. You make concepts very easy to understand. Thank you for this series Akshay.
I'm JS developer with 2+ years of expiriense still I was not aware of these the nuances of JS. Thanks man.
"I found this video to be the most enjoyable till now in the series. Thank you for the excellent explanations that made it easy for me to understand."
आपके समर्पण के लिए धन्यवाद !🔥 Not only did it help me understand how browsers work, but it also made me love JavaScript even more❤🔥