I did loooked on several javascript videos but this video explain the indepth knowledge on a call stack. So it's a helpful and newest topic for me. Thank you, Gaurav Sir for giving a dedicated and practical solution on it.
Please explain this console.log("1"); setTimeout(function() { console.log("2"); },0); Promise.resolve().then(console.log("3")); console.log("4"); When I tried to run this,(promise without any function ) .. I got the output like this 1342 But same If I am trying with function (promise with function ) console.log("1"); setTimeout(function() { console.log("2"); },0); Promise.resolve().then(function() { console.log("3") }); console.log("4"); I got the output--- 1432 IS it because of IIFE ?
Promises are handled in microtask queue, and event loop prioritizes microtask over call back queue, thats why promise reaches the call stacj first.
ekdam mast explanation
Explanation through that microstack and macrostack queue video was crystal clear.
superb thanx for giving best example
Nice explanation 👌
I struggled with this concept always Thank you so much for this video. Now I got it.
I subscribed liked ❤
what a Explanation bro
Brotheer simply wonderful finally my conecept is clear , just one request please share that gif , It was great 😂😂❤
I did loooked on several javascript videos but this video explain the indepth knowledge on a call stack. So it's a helpful and newest topic for me. Thank you, Gaurav Sir for giving a dedicated and practical solution on it.
Best explanation 👍🏻
Wow mene bilkul sahi guess kia tha..😃
Good content
Such a brilliant explanation 👌🏻
hi sir this is the output: 2,5,3,1,4
osm video yr all clear
2, 1, 3, 5,4
Best experience 😊thank you
What if promise takes 15 seconds, will the setTimeout wait for that promise robe competed first???
How to explain event loop in JavaScript for interview
baaki sab i get it but sir pehle console.log kyu print huwa
Thank sir 👍😊 this video
Thank you so much sir
Kindly share the the link of call stack web API process
thanks
Mja aa gya sir
👌👌
Sir ak video call stack ans exucation ke upper bnao pls
Please explain this
console.log("1");
setTimeout(function()
{
console.log("2");
},0);
Promise.resolve().then(console.log("3"));
console.log("4");
When I tried to run this,(promise without any function ) .. I got the output like this 1342
But same If I am trying with function (promise with function )
console.log("1");
setTimeout(function()
{
console.log("2");
},0);
Promise.resolve().then(function()
{
console.log("3")
});
console.log("4");
I got the output--- 1432
IS it because of IIFE ?
So hard to understand what you say, its impossible, please work on your pronanciation G