It was incredibly clear and informative! You did an amazing job breaking down complex concepts in a way that's easy to understand, especially the way the call stack and event loop work together. Thank you for such a well-structured explanation-it really helped me deepen my understanding of JavaScript!
Lots of love and blessings for such an incredible tutorial. You are a great teacher. Thank you so much for making my coding journey easier. May God bless your channel with a billion subscribers. I am one of them. ❤❤❤
Sir Please tell me , whether the callback functions run inside the global execution context or its i executed after all the synchronous code is excuted and global execution is poped out from the stack . if cb fn not executed inside GEC then how they access the values from the scripts.
Bhaiya Mera next month interview hai ap please playlist complete kr denge kya? apka smjhaya hua mind se niklta hi nahi You are my bestest teacher/bro/friend
Can someone clarify my doubt? At 7:41, he said that after executing all the code, everything will be removed from the call stack, including the global execution context. My question is: when the event loop pushes the setTimeout function to the call stack, does it create a new global execution context or a local execution context? Or does the global execution context remain in memory until the entire JavaScript code has completed execution?
It does not pushes the setTimeout function entirely into call stack It pushes the callback function(not setTimeout bro) provided to setTimeout to Macro-task queue and then pushes to call stack. Also global execution context doesn't remains in the call stack, it 's kicked out before pushing the callback but the variables are still stored in the memory!
@shahwaizkarim-h9z thats my mistake i know that only function pushes in the stack but question is still same how without global execution context the function run on stack ? I think to run any code there should be an execution context.
Most of the thing is clear now. A question: since we pass callback functions inside the setTimeout and Promise. So when these function goes from web Api to task queue and microtask queue respectively then to call stack. how or who calls these callback functions?
is promise part of webapi like settimeout in JS? 2/2 ChatGPT said: ChatGPT No, Promises in JavaScript are not part of the Web API. They are part of the JavaScript language itself, specifically introduced in ES6 (ECMAScript 2015). Please explain @piyushgargdev
Script: console.log("Hello World"); setTimeout(() => { console.log("Hello World after 0 seconds"); }, 0);
setTimeout(() => { console.log("Hello World after 2 seconds"); }, 2000);
setTimeout(() => { console.log("Hello World after 0 seconds 3th time"); }, 0);
console.log("bye bye"); Answer: Hello World script.js:17 bye bye script.js:4 Hello World after 0 seconds script.js:12 Hello World after 0 seconds 3th time script.js:8 Hello World after 2 seconds
Look like piyush comes to surpass every youtuber. Honestly bro your best now
Also video on how node handles 1000s of request at a time we need
No one can beat you when its comes to explanation ❤
tusi chha gye sir, pahli bar samaj me aaya ye lafda, javascript ka...
ap ka video bht he acha lga. and thank you so much event loop ab smj lg gy .. after 6 year
Great content❤.
I would to see videos on OOPS in javascript and a small project using OOPS
It was incredibly clear and informative! You did an amazing job breaking down complex concepts in a way that's easy to understand, especially the way the call stack and event loop work together. Thank you for such a well-structured explanation-it really helped me deepen my understanding of JavaScript!
Lots of love and blessings for such an incredible tutorial. You are a great teacher. Thank you so much for making my coding journey easier. May God bless your channel with a billion subscribers. I am one of them. ❤❤❤
you are truely amazing the way of explaining the how javascript works behind the scene. Even a begginer can understand clean detailed way
Best content I have ever seen on RUclips. Learned many many more things. Thank You and please continue making this type of videos
Best explanation of the event loop brother. You literally killed it
bro u are a one of the best teachers
You have a great power to make understand others, Thank you so much!!!!
Thanks for the knowledge sir.
Understood Everything, Nice Explanation, Looking forward for next videos!!!
the way he explains can't be explained in words❤
Ossam explanation piyush bhaiya 😊😊
Fine! how nice to understand,Thank you so much!!!
YOU RE A LEGEND.
Hii
You are great explainer of tech now evolving around developers.
Helping me to get Advance in JS
Thank you bahi
Nicely explained 🔥
I am from Bangladesh. You're really amazing.
Thank you so much sir!
Thank you for this wonderful videos
Exited for next video ❤
Sir Please tell me , whether the callback functions run inside the global execution context or its i executed after all the synchronous code is excuted and global execution is poped out from the stack .
if cb fn not executed inside GEC then how they access the values from the scripts.
Best explanation
A Wonder Full Content Bro
Bro Need Series on React
thank you piyush.
Bhaiya Mera next month interview hai ap please playlist complete kr denge kya?
apka smjhaya hua mind se niklta hi nahi
You are my bestest teacher/bro/friend
Very nice video ❤
Please make some video on typescript also.
very well explained.
Can someone clarify my doubt? At 7:41, he said that after executing all the code, everything will be removed from the call stack, including the global execution context. My question is: when the event loop pushes the setTimeout function to the call stack, does it create a new global execution context or a local execution context? Or does the global execution context remain in memory until the entire JavaScript code has completed execution?
It does not pushes the setTimeout function entirely into call stack It pushes the callback function(not setTimeout bro) provided to setTimeout to Macro-task queue and then pushes to call stack. Also global execution context doesn't remains in the call stack, it 's kicked out before pushing the callback but the variables are still stored in the memory!
@shahwaizkarim-h9z thats my mistake i know that only function pushes in the stack but question is still same how without global execution context the function run on stack ? I think to run any code there should be an execution context.
I guess he talks about execution of code not hoisting for hoisting there might be another mechanism
An amazing explanation can you make this type of series for Mern stack also everyone is waiting for that
Thank you sir ❤
Most of the thing is clear now. A question: since we pass callback functions inside the setTimeout and Promise. So when these function goes from web Api to task queue and microtask queue respectively then to call stack. how or who calls these callback functions?
Thanks
You are best
Thank you sir
just woow
great
yes it's awesome
Please make this type of video on nodeJs
fetch metho also comes into micro task queue
Flashbang warning at 1:38
🔥🔥🔥
great
Make a playlist on javascript and node js interview
Bro i have completed your js playlist,
but completing and checking more things, i found that some topics are missing like object
I recently started backend in javascript, please help me how can i practice it more
Gem!
add one more example executing setTimeout and setImmediate then what will happened, webapi and event loop
Hi, Please makes a series for js logic development skill from 0 to advance
1:39 light mode activated ⚠️
Stay safe.
please continue the rust series
💛
🏅 प्रथम
Please please please continue rust series'
❤
your explaination are super good, i would be nice if u do all videos in english
English subtitles???
Light Mode🫣
good going , I am a boy still I feel U are cute 😆
Promises are not part of WebApis
is promise part of webapi like settimeout in JS?
2/2
ChatGPT said:
ChatGPT
No, Promises in JavaScript are not part of the Web API. They are part of the JavaScript language itself, specifically introduced in ES6 (ECMAScript 2015).
Please explain @piyushgargdev
Script:
console.log("Hello World");
setTimeout(() => {
console.log("Hello World after 0 seconds");
}, 0);
setTimeout(() => {
console.log("Hello World after 2 seconds");
}, 2000);
setTimeout(() => {
console.log("Hello World after 0 seconds 3th time");
}, 0);
console.log("bye bye");
Answer:
Hello World
script.js:17 bye bye
script.js:4 Hello World after 0 seconds
script.js:12 Hello World after 0 seconds 3th time
script.js:8 Hello World after 2 seconds
you always bark in hindi