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. ❤❤❤
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
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.
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?
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
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
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...
The best explanation ever, so clear it is
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!
Great content❤.
I would to see videos on OOPS in javascript and a small project using OOPS
Best explanation of the event loop brother. You literally killed it
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 TH-cam. Learned many many more things. Thank You and please continue making this type of videos
You have a great power to make understand others, Thank you so much!!!!
ap ka video bht he acha lga. and thank you so much event loop ab smj lg gy .. after 6 year
Thanks for the knowledge sir.
You're Way of Teaching is Amazing🤩🤩
bro u are a one of the best teachers
Fine! how nice to understand,Thank you so much!!!
the way he explains can't be explained in words❤
Ossam explanation piyush bhaiya 😊😊
Understood Everything, Nice Explanation, Looking forward for next videos!!!
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. ❤❤❤
Thank you so much sir!
Thank you for this wonderful videos
Helping me to get Advance in JS
Thank you bahi
Hii
You are great explainer of tech now evolving around developers.
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
Nicely explained 🔥
A Wonder Full Content Bro
Bro Need Series on React
I am from Bangladesh. You're really amazing.
top notch content bhai thnx
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.
Very nice video ❤
Please make some video on typescript also.
thank you piyush.
Thank you sir ❤
Please make this type of video on nodeJs
very well explained.
Exited for next video ❤
YOU RE A LEGEND.
fetch metho also comes into micro task queue
An amazing explanation can you make this type of series for Mern stack also everyone is waiting for that
You are a Gem!!
Thanks
Best explanation
Make a playlist on javascript and node js interview
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
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?
Flashbang warning at 1:38
Hi, Please makes a series for js logic development skill from 0 to advance
add one more example executing setTimeout and setImmediate then what will happened, webapi and event loop
please continue the rust series
I recently started backend in javascript, please help me how can i practice it more
just woow
great
yes it's awesome
You are best
great
1:39 light mode activated ⚠️
Stay safe.
Please please please continue rust series'
nice
Bro i have completed your js playlist,
but completing and checking more things, i found that some topics are missing like object
🔥🔥🔥
English subtitles???
💛
🏅 प्रथम
❤
your explaination are super good, i would be nice if u do all videos in english
Promise are part of JS not web APIs
preidtion 14:42 scirp 1
script2
end script
bye bye
b
a
c
i tought call stack should execute the lat in first so b wil print first but the que will put b only if a got logged and stack is empty ig
good going , I am a boy still I feel U are cute 😆
Light Mode🫣
Promises are not part of WebApis
Gem!
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
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
you always bark in hindi