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.
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
No one can beat you when its comes to explanation ❤
Also video on how node handles 1000s of request at a time we need
tusi chha gye sir, pahli bar samaj me aaya ye lafda, javascript ka...
the way he explains can't be explained in words❤
Great content❤.
I would to see videos on OOPS in javascript and a small project using OOPS
thank you piyush.
Best content I have ever seen on UA-cam. Learned many many more things. Thank You and please continue making this type of videos
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.
Thank you for this wonderful videos
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
Hii
You are great explainer of tech now evolving around developers.
Best explanation
An amazing explanation can you make this type of series for Mern stack also everyone is waiting for that
Very nice video ❤
Please make some video on typescript also.
Thank you sir ❤
Understood Everything, Nice Explanation, Looking forward for next videos!!!
Ossam explanation piyush bhaiya 😊😊
Exited for next video ❤
Thank you sir
A Wonder Full Content Bro
Bro Need Series on React
I recently started backend in javascript, please help me how can i practice it more
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.
Make a playlist on javascript and node js interview
You are best
Bro i have completed your js playlist,
but completing and checking more things, i found that some topics are missing like object
fetch metho also comes into micro task queue
great
🔥🔥🔥
Please please please continue rust series'
❤
please continue the rust series
🏅 प्रथम
💛
1:39 light mode activated ⚠️
Stay safe.
English subtitles???
Light Mode🫣
good going , I am a boy still I feel U are cute 😆
your explaination are super good, i would be nice if u do all videos in english
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