I need to admit that after completing your series, my approach has changed and the way I look at the code has changed and also I'm easily able to answer the coding outputs for most of the problems. Completed Revision of this series 😁
Thanks for commenting. In case if you not subscribed to my channel please subscribe and watch all my videos. Yes, this is quite confusing topic, even those candidates who have read this topic get confused in the interview. Good that you watched my video and learnt it fully.
Nice video and thank you for clearing the concept. Just one thing plz mention that your nested promise approach and the await approach are not the same 1. promise1().then( () => promise2().then( () => promise3.then( () => console("blah blah blah") ) ) ) is not same as 2. await promise1() await promise2() await promise3() as the second approach is faster because in 1. the promises wait for parent promise to finish and in 2. all the promises fire at once. So 2 is faster and promises are independent of each other.
Thanks for commenting. In case if you not subscribed to my channel please subscribe and press the bell icon and watch all my videos and share the channel with your friends. Sorry Himanshu it took sometime for me to reply to your comments. Both are same, await promise1() await promise2() await promise3() Here promise2() will not be triggered until promise1() is completed. As the very word means await, main thread waits for the promise1() to complete before processing promise2().
This question really killed my head when I first saw async and await, now it's clear, thank you for the video vasant🙌🙌❤❤
Glad it helped .. join our telegram group here: t.me/uncommongeek
Thanks I was also confused in this question in one of my past interview. Thanks for demostrating it
Glad it was helpful! please share channel details with your friends !!
Maja aa gaya sir , concept clear ho gaya....
Thank you Piyush, please spread the channel details with your friends.
@uncommongeeks Already done Sir 😃
I need to admit that after completing your series, my approach has changed and the way I look at the code has changed and also I'm easily able to answer the coding outputs for most of the problems.
Completed Revision of this series 😁
Great to hear! Sateja, thanks for completing the series.
Can we say async function returns us a promise and "await" keyword blocks the function execution context ???
Thanks for solving simple yet trickly interview ques
Most welcome
The question does async/await block main thread came to my mind while I'm learning async/await. Thanks for clearing confusion.
Thanks for commenting. In case if you not subscribed to my channel please subscribe and watch all my videos. Yes, this is quite confusing topic, even those candidates who have read this topic get confused in the interview. Good that you watched my video and learnt it fully.
Nice video and thank you for clearing the concept. Just one thing plz mention that your nested promise approach and the await approach are not the same
1. promise1().then( () => promise2().then( () => promise3.then( () => console("blah blah blah") ) ) )
is not same as
2.
await promise1()
await promise2()
await promise3()
as the second approach is faster because in 1. the promises wait for parent promise to finish and in 2. all the promises fire at once. So 2 is faster and promises are independent of each other.
Thanks for commenting. In case if you not subscribed to my channel please subscribe and press the bell icon and watch all my videos and share the channel with your friends.
Sorry Himanshu it took sometime for me to reply to your comments. Both are same,
await promise1()
await promise2()
await promise3()
Here promise2() will not be triggered until promise1() is completed. As the very word means await, main thread waits for the promise1() to complete before processing promise2().
helpful !! thank you
Glad it was helpful!
Wow thank you so much
This is the basics of JS, if you don't know how JS engine works then you have a problem
Appreciate the comments !! People climb the ladder, nobody is born genius. Basic to you may not be same for others !!
Much needed
awesome
Thanks for commenting. In case if you not subscribed to my channel please subscribe and press the bell icon and watch all my videos.
crisp
I failed to answer here 😜