async await | Namaste JavaScript - Season 02 - Ep 04

  Рет қаралды 319,612

Akshay Saini

Akshay Saini

Күн бұрын

Пікірлер: 1 600
@akshaymarch7
@akshaymarch7 Жыл бұрын
🔥Dive deep into React JS with me, checkout `Namaste React` - namastedev.com/namaste-react Like this video and subscribe to the channel for more new video coming very soon. 🚀 Also comment down below what topics should I cover next.. ✌
@niteshrathore4341
@niteshrathore4341 Жыл бұрын
@akshaymarch7 can you explain the higher order component also
@PamelaSummers-n6n
@PamelaSummers-n6n Жыл бұрын
Sir please launch a react js course with starting from javascript and also include backend part also
@ksubramanyeshwara
@ksubramanyeshwara Жыл бұрын
It would be nice if you make 3 to 5 projects in vanilla JS including all the basics to advanced concepts. Machine coding questions and System design as well. Also DSA in JavaScript would be awesome. 🙏🙏🙏
@twitterupdate8072
@twitterupdate8072 Жыл бұрын
Sir please cover AJAX,
@Vj_0_4
@Vj_0_4 Жыл бұрын
Omg please do complete season 2 thats the least we could ask for please put a proper fullstop on this gem playlist❤😊
@GAURAVMOKASHI
@GAURAVMOKASHI Жыл бұрын
Akshay Sir, Please clarify my doubt ! const p1 = new Promise( (resolve, reject) =>{ setTimeout(() =>{ resolve("Promise Resolved Value!!") }, 10000); }); const p2 = new Promise( (resolve, reject) =>{ setTimeout(() =>{ resolve("Promise Resolved Value!!") }, 5000); }); async function handlePromise(){ console.log("Hello World !!") const val = await p1; console.log("Namaste Javascript") console.log(val) const val2 = await p2; console.log("Namaste Javascript 2") console.log(val2) } handlePromise(); In the above condition, when p1 will resolve after 10 seconds, and p2 will resolve after 5 seconds then we see that after 10 seconds it will resolve both value. As p2's setTimeout value is lesser(5 Seconds) than p1.(10 Seconds) As you said when JavaScript fetch or reach the line of handlePromise function the following this will be happen. 1. In call stack first handlePromise is loaded and it console log the "Hello World !!" 2. Then it go to the next line, finds that there has been await p1. 3. When it saw await p1, handlePromise Function remove from call stack. 4. After the 10 seconds over, then Function go to call stack and start execution from where it is left. 5. Now the "Namaste Javascript" is print and also the val value i.e. "Promise Resolved Value!!" Now my query is How it will print/console.log the "Namaste Javascript 2" and also the val value i.e. "Promise Resolved Value!!" ? Because as I follow you in the Video, at that time it will not fetch the const val2 = await p2 Line. When it fetch "const val2 = await p2 ;" Logically It will then Remove the handlePromise Function remove from call stack Again. So before it go to "const val2 = await p2 ;" Line Interpreter do not know that there has another AWAIT Function there. (i.e. const val2 = await p2;) So how it prints "Namaste Javascript 2" and "Promise Resolved Value!!" for second time after 10 seconds? Please enlighten me for this condition. Thank you for Namste React also!
@GAURAVMOKASHI
@GAURAVMOKASHI Жыл бұрын
Inshort Did p1 and p2 promises are resolved simultaneously during function execution? As p1 took 10 sec, does it mean in background ,p2 was also getting executed? I'm not getting it why Js engine didn't wait for p2 since after executing promise p1, it execute p2 and should wait for p2 to resolve because p1 and p2 are different promise and can have different operations.
@nikunj0706
@nikunj0706 Жыл бұрын
@@GAURAVMOKASHI The reason is, promises are not getting started executing when the function is called and it reaches to line 28 [At 43:21 ]Promises were added in the call stack a way before, before the function execution started. So, you are right, untill line 28 is getting executed, js will not move furhter, But P2 was already started running when jt encountered at line 18. Now simply understand this as, call the same function twice. Only first promise in the first function where function will get suspended and wait. For all other 3 promises there will be no wait and values will be printed no time
@nikunj0706
@nikunj0706 Жыл бұрын
The reason is, promises are not getting started executing when the function is called and it reaches to line 28 [At 43:21 ]Promises were added in the call stack a way before, before the function execution started. So, you are right, untill line 28 is getting executed, js will not move furhter, But P2 was already started running when jt encountered at line 18. Now simply understand this as, call the same function twice. Only first promise in the first function where function will get suspended and wait. For all other 3 promises there will be no wait and values will be printed no time
@vikaskumar-hc1cs
@vikaskumar-hc1cs Жыл бұрын
1. In call stack first handlePromise is loaded . and excution context is created for handlePromise. a) Their is two phase one is memory phase and second excution phase . when code goes from memory phase it see the promise and it will register a promise . b) when code goes in second phase ( excution phase) it will see that promise it resolve or not. ** every js program run in two phase sorry for bad english
@bm9code
@bm9code Жыл бұрын
@@vikaskumar-hc1cs no problem with your English; from where do you got this information, is there any resource
@omkarshidore4062
@omkarshidore4062 Жыл бұрын
Great energy, throughout the series, I've been working into backend, cloud & data-science for past 4 years, wanted to understand frontend for System design, Luckily I ran into your channel, spent the new years long weekend on both seasons of NamasteJS. Sending some love! Keep rolling out the content! 🍻
@trialaccount2244
@trialaccount2244 10 ай бұрын
Ques). for those who thinks if code reaches await of p1 suspends function execution and after 5 sec it should go to await p2 the timer for p2 should start and should take 10 sec there so overall function execution should be 15sec? Ans). the timer ticking doesn't start at await, instead it started in the beginning of the code only where promise was declared. If the declaration would have been like inside async p1 declare then p1 await after that p2 declared follwed by p2 await then function would have taken 15 secs
@prachuryaray9034
@prachuryaray9034 8 ай бұрын
Exactly. The concept of hoisting comes into play.
@sourabhgarg2890
@sourabhgarg2890 6 ай бұрын
thanks bro u cleared my doubt
@Daisy01-M
@Daisy01-M 5 ай бұрын
@@prachuryaray9034 did not get can you clarify it more ?
@amalenduguru2456
@amalenduguru2456 5 ай бұрын
this. You saved me
@PANKAJSHARMA-yu1ns
@PANKAJSHARMA-yu1ns 4 ай бұрын
Please pin this comment, helps understand the execution of promises better
@shubhsharma19
@shubhsharma19 11 ай бұрын
Idk why this video has so less likes, this deserves so much appreciation!
@akshaymarch7
@akshaymarch7 11 ай бұрын
Thank you, please share this on social media and to your friends and help us reach more people out there. Your support is much valuable to us. ♥️
@shubhsharma19
@shubhsharma19 11 ай бұрын
All my serious programmer friends watch your content already haha @@akshaymarch7
@AmarSingh-uw1db
@AmarSingh-uw1db Жыл бұрын
Gratitude Sirji ❤❤. I request Sir to please make videos on 1) Design patterns 2) Solid Principles 3) File Upload(Single and Multiple) 4) Video Upload as Data stream 5) Forms with validation, error handling and warning messages 6) Ajax and xmlhttpRequest 7) Importing javascript and code Reusablility
@LokeshSharma-v2s
@LokeshSharma-v2s 11 ай бұрын
you and your skills its too AMAZING after the long practice with other KZbinrs today I have cleared my doubts so thanks for this but bhai aisa mat karna ki ye course bhi paid kar do tum😃😃😃
@mohammadaffan6702
@mohammadaffan6702 10 ай бұрын
Promise: Think of a promise as a guarantee made by someone (like a function) to do something and provide you with the result later. It's like ordering food at a restaurant. You get a promise (receipt) saying your order will be ready soon. You can wait for it (.then()) or check on it later (.catch()). Async/Await: Async/await is like asking someone (a function) to do something for you, but instead of waiting for them to finish right there, you tell them you'll do something else while they work. It's like asking a friend to pick up your order from the restaurant. You can go do other things (like order a drink) while your friend (the async function) waits for the food (awaits the promise).
@Zeal-venkat
@Zeal-venkat 17 күн бұрын
wow nice explanation bhai
@ganeshpavan7895
@ganeshpavan7895 Жыл бұрын
This was very useful in diving deep to know how exactly things are running behind. Could you also please do a video on how exactly the callstack/fetch webapi/callback queue/micro task queue behaves when async function code reaches to await or using multiple awaits in a single async promise function.
@SAKSHIKATARIA
@SAKSHIKATARIA 5 ай бұрын
This will be helpful if we get this , Only this part is missing in this video. otherwise This is complete picture of async await :). and whole course is just wow. Thanks @akshay.
@premshahu9321
@premshahu9321 Жыл бұрын
4 page of notes , simplified and yet deep dive into the concepts why people don't understand and take an interest in learning anything of the teacher is this much enthusiastic and passionate about teaching code . Actually I find some of you tube channels that teach coding are just coders after a long I saw a proper coding teacher who can teach me and beleive I didn't get bored at all and by the time my intrest in knowing just keep increase. You are the teacher that not only teach but also develops the energy and enthusiasm and will to learn Thank you Akshay sir ❤
@komalpatil4711
@komalpatil4711 10 ай бұрын
Must watch for All Front End Developers!!! Nothing can beat his way of explanation and his deep understanding.
@borntobefree8298
@borntobefree8298 Жыл бұрын
Never seen a better explanation than this, How much you must be working to get all this knowledge and then putting out here for all of us with so much of effort and work. Thanks from all the developer community. You are a true teacher. Please keep teaching all of us .
@slayerxox
@slayerxox 21 күн бұрын
even after 100s of years when future generations have to learn the core of javascript, this is the place where they all will come for. this is beyond any any paid courses out there in market. the simplicity you explained such confusing concepts, i bet no one else could do it. we are lucky to learn js from you sir
@dheerajsharma-of8xs
@dheerajsharma-of8xs 6 ай бұрын
• Async/await used for handling promises • Async always return a promise ° Await can only used inside an async function ° Can only write await keyword infront of a promise ° While awaiting JS Engine does not actually wait rather the function is suspended and call stack is free for other stuffs but it looks like program is waiting at that point ° Use try catch for Error handling and can also use . Catch() method
@nutankumari8184
@nutankumari8184 8 ай бұрын
The best javascript and react teacher. You are the real gem. Thank you for sharing your knowledge with us. I have learned from many teachers on youtube but no one teaches like you.🙇‍♀🙇‍♀
@G_O_J_O_S_A_T_O_R_U
@G_O_J_O_S_A_T_O_R_U Жыл бұрын
I wanted to take a moment to express my sincere appreciation for your course "Namaste Javascript". Your teaching style is clear and concise, and the way you explain complex concepts is truly impressive. I particularly enjoyed the practical examples you provided, which helped me to better understand the material. Thank you for sharing your knowledge and expertise with the world. I look forward to learning more from you in the future.
@67009
@67009 Жыл бұрын
Anyone purchase his namste react course? ...please let me knnow that all hooks are covered or not..? i am also planning to buy that's the reason i am asking...becoz in playlist its not mention about hooks ...i saw only useSate and memo hook...so please tell me if any one purchased..thankyou..
@G_O_J_O_S_A_T_O_R_U
@G_O_J_O_S_A_T_O_R_U Жыл бұрын
@@67009 yes i have purchased it recently and let me tell you my friend this is the best react course i have found. I have currently completed 2 projects. Its very good not only for his teaching but the community support of namaste react is very good you will get to see lot of react devs. I entered this course with absolutely no knowledge on some of the topics like redux and testing and all . But now i feel very confident in it
@G_O_J_O_S_A_T_O_R_U
@G_O_J_O_S_A_T_O_R_U Жыл бұрын
@@67009 about hooks akshay has covered many hooks while doing the project. In theory he did not go in deep about irrelevant hooks but while doing project he covered most of them including custom hooks also
@67009
@67009 Жыл бұрын
@@G_O_J_O_S_A_T_O_R_U thankyou buddy..
@mwesigyenicholas7394
@mwesigyenicholas7394 11 күн бұрын
i have been right my backend using node.js and express.js with react.js at my frontend , its today that i have realized that i did not know what i was writing up to now. now everything is solid clear thanks sir for this series
@nk17nikky
@nk17nikky Жыл бұрын
I'm an QA engineer and wanted to learn JS concepts to prepare for my job interviews. And after watching all of your videos season 1 and 2, I'm feeling so confident that I can crack Developer JS interviews (after some practice obviously). Thank you so much for making the Namaste JavaScript series. 🙏Namaste 🙏
@karanahir9
@karanahir9 Жыл бұрын
Amazing work Akshay!! I can say I Understand promises much better now after this video!
@akshaymarch7
@akshaymarch7 Жыл бұрын
Thank you so much for supporting my channel. This means a lot. ❤️
@rohinijadhav7224
@rohinijadhav7224 Жыл бұрын
Thank you for sharing your knowledge😄Akshay. Please add following topics as well in namste JS season 2: 1. Browser - behind the scenes 2. DS in javascript 3. How to improve performance of application
@akshaychavan5511
@akshaychavan5511 6 ай бұрын
No one can match Akshay's energy while teaching. He's as curious as a small kid. Love it!!
@raghavbansal8068
@raghavbansal8068 Жыл бұрын
Thank you soo much for such a mindblowing explaination 🔥 I bet there couldn’t be a better explanation for covering such complex topic in such easy way.
@akshaymarch7
@akshaymarch7 Жыл бұрын
Thanks for supporting my channel, means a lot to me!
@romaghosh8649
@romaghosh8649 4 ай бұрын
my husband bought namaste React course for me and once I complete this whole season 2 videos , i will start with that course.
@garh.kumaon
@garh.kumaon 3 ай бұрын
Can you review the course? Namaste react
@rahulmaurya6451
@rahulmaurya6451 Жыл бұрын
You made us Fall in love with JS ❤.. You are a true Gem . Please don't stop making videos , We can not get these premium content anywhere else,, we are totally rely on you,, It's pleasure to see you back again. Thankyou for making such amazing contents ❤
@Gourav-kl5jt
@Gourav-kl5jt Жыл бұрын
Akshay, You are a great teacher. I am really enjoying javascript now.
@abhijitpanchal7048
@abhijitpanchal7048 28 күн бұрын
I came here after completing the Namaste Javascript season 1. These playlists are the best resources to learn working of Javascript in detailed way. I have never understood these concepts so easily. Thanks a lot for the efforts, really appreciate it.
@juhibhardwaj6275
@juhibhardwaj6275 Жыл бұрын
One of the best teachers I have ever seen. I deeply appreciate the unwavering effort you put into your teaching. Thanks for the awesome content 🙂
@cantcode1001
@cantcode1001 4 ай бұрын
Hands down the BEST explanation of async/await I've ever seen. You sir, are a treasure, a scholar, and a gentleman. Thank you so much! You are a born teacher!
@kunalnailwal369
@kunalnailwal369 Жыл бұрын
Teacher like you can literally boost confidence in new coming developers like me. Please never stop teaching us🙏
@gautamnegi-wh9xi
@gautamnegi-wh9xi Жыл бұрын
Best Best Best that is what this video is, when you say nobody teaches this, that is literally true the way you explain the way you teach the way you deep dive that is simply amazing amaaaaaazingggg. I purchased your react course the way you taught the knowledge you shared in that course was next level the best thing was you actually knew where we the one watching the course will get stuck so you taught accordingly really appreciate it. You are Amazing a teacher.
@hardikjain_08
@hardikjain_08 Жыл бұрын
I wish there were more amazing teachers like you can't thank you enough. I once hated web development now I love Js and react just because of the way you teach. Thank you Sir 🙏
@Sam-ps5xs
@Sam-ps5xs 10 ай бұрын
I am a developer with 2 yrs experience and for the first time I understood this topic completely. I have had read some articles previously but it didn’t gave me the complete understanding. Thank you for this. Never knew it was easier
@Vishnu-lc9gt
@Vishnu-lc9gt Жыл бұрын
A movie can't hold my attention for an hour , but this glued me to my screen for the full episode. Great video as usual!🤩
@saisaranyan9208
@saisaranyan9208 11 ай бұрын
Akshay, I wish I had teachers like you during my college.. Thanks for making this course available for free in KZbin. I have enrolled for Namaste React few days back. Wish you all the success.
@Abi-rv3qk
@Abi-rv3qk Жыл бұрын
I have completed Namaste JavaScript Seasons 1 and 2, and wow, what a course! . lots of in-depth knowledge about JavaScript, which I'm confident will stay with me for life. Anything bigger than this would only be in dreams. Now, I'm excited to start the React JS course. 😊 And you are the best teacher I've ever seen. Keep up the great work!"❤
@akshaymarch7
@akshaymarch7 Жыл бұрын
Wish you the best, keep rising! 🚀
@lostgen36
@lostgen36 Жыл бұрын
Amazing how all the concepts you taught in season 1 about task queue, microtask queue, call stack, event loop, execution context are in play here! There is nobody else who explains these topics in such deep level! But once you understand these in deep level and get your hands dirty in the chrome dev tools, it all just makes sense!
@lkshh4891
@lkshh4891 9 ай бұрын
43:02 so we can say that settimeout counter for both promises starts simultaneously but p2 resolves when p1 resolves which is after 10 s and for initial 5s setTimeout counter of p2 finishes but resolves when p1 resolves so it waits for another 5s for case where - p1 waits for 10s and p2 waits for 5s
@sanjusabu5488
@sanjusabu5488 9 ай бұрын
yes that because they are declared globally if they were declared inside a function and called separately, the timer would be started as they are called and not simultaneously. He missed this part.
@hersheynaik3029
@hersheynaik3029 Жыл бұрын
what a coincidence I just finished watching Namaste React and was sad it got over and I came to KZbin to check out your channel. BOOM new video🥳. OMG. After Namaste React I feel like I found the right path to learning new things in the right way. Thank you so much. I will give you a guru Dakshina when I get a job🤞
@sandeeproy6564
@sandeeproy6564 Жыл бұрын
Do you feel like you can create an application on your own, after you've finished Namaste React? Give us a review of your experience with the course please.
@aloktrivedi3285
@aloktrivedi3285 Жыл бұрын
I also learned js from #akshaysaini, and currently I am learning react with nextjs (bcoz it becomes very easy to learn react with nextjs). What is your review of this course, is it worth paying 2000 for this course. Plzz tell
@hersheynaik3029
@hersheynaik3029 Жыл бұрын
@@aloktrivedi3285 100% worth it. He also goes in-depth and gives great insights about how everything actually works behind the scenes. After this course not only nextjs You can use or pair any library or framework with React with ease.
@hersheynaik3029
@hersheynaik3029 Жыл бұрын
@@sandeeproy6564 yess. Although I knew some basics of react, this course literally changed my perspective. I have confidence that I can build any web app now. The thing is after watching the lecture please put extra efforts of researching by yourself and code it. Try adding extra features etc. It'll be fun.
@bajishaik4802
@bajishaik4802 Жыл бұрын
@@aloktrivedi3285 it is totally worth of paying 2000 or even more, because in this we actually build projects not just learning react and after this course you can have ability to build some other applications as well.
@archan_pandya
@archan_pandya 10 ай бұрын
Your ability to explain everything is simply amazing! Thank you for your fantastic videos 🙏
@pavankulal9311
@pavankulal9311 Жыл бұрын
I wish we would have teacher like you in college what an explanation 🙇. You make anything interesting. I have coding for 1 year I didn't knew how did it work behind the scenes . Thank you so much sir ❤️🙇
@akshaymarch7
@akshaymarch7 Жыл бұрын
@Codifywebee
@Codifywebee 8 ай бұрын
You're just crazy. I have never seen anyone who teaches like you. I just loved it.
@the_corporate_wallah
@the_corporate_wallah Жыл бұрын
Sir, It is because of you that I understood JavaScript. And today I am working as a javascript developer. Thank you so much Sir 😊❤
@akshaymarch7
@akshaymarch7 Жыл бұрын
@knowledgedose1956
@knowledgedose1956 Жыл бұрын
​​@@akshaymarch7I think at some point in video it starts repeating. Look at 7:45
@skzahirulislam2820
@skzahirulislam2820 Жыл бұрын
​@@knowledgedose1956repetition is good
@AdnanAli-cp9hk
@AdnanAli-cp9hk 7 ай бұрын
Akshay Saini Sir, u should be the brand ambassador for JavaScript! Amazing Amazing explanation!. Thankyou so much.
@sushankznation
@sushankznation Жыл бұрын
Thank you, Akshay, for such an amazing series. I'm eagerly waiting for #NamasteDSA now ;)
@prasannakr887
@prasannakr887 Жыл бұрын
Yes, We need #NamasteDSA
@ksubramanyeshwara
@ksubramanyeshwara Жыл бұрын
everyone waiting
@nezukochan90
@nezukochan90 5 ай бұрын
first time seen such a crystal clear explaination !!
@sumitkawale2549
@sumitkawale2549 Жыл бұрын
I was waiting so long for this series ❤❤❤. Glad that you come back
@KrishT0
@KrishT0 Жыл бұрын
really its the only video in the youtube which cleared the async await concept at very deep level.
@AshwaniMaddheshiya-d2k
@AshwaniMaddheshiya-d2k Жыл бұрын
If this video had been made earlier, I would have done 2 more internships by now. But Thanks a lot❤. Didn't found a single video on KZbin who makes me understood it so well as you did.
@jaymaheshwari1075
@jaymaheshwari1075 9 ай бұрын
Bro didn't even hesitate to make this complex topic look so simple, kudos to you Sir.
@ksubramanyeshwara
@ksubramanyeshwara Жыл бұрын
Welcome back. Waiting for more topics to be covered. Also bring machine coding and system design and DSA in JavaScript please 🙏
@anupam6045
@anupam6045 5 ай бұрын
Before watching this video i considered Async and Await as complicated part of javascript but now my every concept is crystal clear, and I loved how you broke down complex concepts into easy-to-understand steps. Thank you akshay bhaiya for putting your 100%+ effort .
@krishnamoorthysrinivasan1737
@krishnamoorthysrinivasan1737 Жыл бұрын
at 45:16 in your example when you say 40 seconds for the second promise its actually 20 seconds after the first promise is executed but totally it takes 40 seconds from the beginning which says JS doesn't wait :)
@kartiklanjewar2892
@kartiklanjewar2892 6 ай бұрын
yes,correct
@kamalakantapanda4255
@kamalakantapanda4255 Жыл бұрын
Tiger is back
@swamipatil4566
@swamipatil4566 Жыл бұрын
Loda tigers😂
@vamshikrishna6001
@vamshikrishna6001 Жыл бұрын
Yes he resembles 🐅 😅. Orange & black 😂
@poojamishra1306
@poojamishra1306 6 ай бұрын
Bhaiii, maan gayi bhaiii... the absolute clarity I am gaining... such an addiction watching u teach all of such topics so easily.. just blows my mind... , not commented so far.. but this explanation and trying to cover all cases so that we gain absolute clarity.. this is the type of teacher we wait for. Thank you so much! I am on the verge of completing this Javascript through you w feel so knowledge loaded.. even though I have not used javascript from a long time, I was able to understand all of it very easily and the foundations! Thank you!!
@SandeepSaini-tr9sv
@SandeepSaini-tr9sv Жыл бұрын
i am skipping any movies or web shows just for this series ❤
@zameerkhan4780
@zameerkhan4780 4 ай бұрын
The energy that you put into teaching the concepts made me fall in love with java script.
@k.ashutoshbaitharu3964
@k.ashutoshbaitharu3964 Жыл бұрын
I watched the whole series and while waiting for this particular episode I landed a job, Thank you Akshay, the concepts learned from you in Namaste JS one way or another helped me secure the position.
@akshaymarch7
@akshaymarch7 Жыл бұрын
Congratulations, wish you the best for your career ahead. 🚀
@ritikraj.18
@ritikraj.18 6 ай бұрын
Thank you for such a detailed video akshay. Even after having worked on JavaScript for years now and writing async functions every other day, I was not aware of how things actually work behind the sence. I couldn't find anyone who takes a topic and grinds it this much. All I get to hear is "Asyc-Await is a wrapper over promises that makes the async code look like synchronous". All shallow stuff :). Request you to kindly continue bringing such rich content for us.
@rajchaurasiya1265
@rajchaurasiya1265 5 ай бұрын
Bhai yaar kasam se pdh ke mjaa he as gya itna excitement to movie me nhi aata😅😅 jo mind me question chal rha vhi next smjha rhe bhai and also explain edge cases🎉❤
@rajchaurasiya1265
@rajchaurasiya1265 5 ай бұрын
Itne subh subh aap comments pdhte hai bhaiya
@rajchaurasiya1265
@rajchaurasiya1265 5 ай бұрын
Aapke react ka course he pdh rha ho
@pujadey355
@pujadey355 10 ай бұрын
Omg, how can someone explain in such a simplified way? Thank you so much for this. U are a great teacher.
@aloktrivedi3285
@aloktrivedi3285 Жыл бұрын
After so many days akshay bhaiyaa you are back😍😍😍😍. I am planning to purchase your namaste react course. I started learning js from your namaste js series, and now it's been 6 months 🥰🥰🙏🙏🙏🙏
@vinayakag900
@vinayakag900 Жыл бұрын
On which platform Namaste react course is available
@aloktrivedi3285
@aloktrivedi3285 Жыл бұрын
@@vinayakag900 on his own website namastedev
@ishantkushwaha534
@ishantkushwaha534 Жыл бұрын
​ @vinayakag900 Namaste Dev website.
@parveshqaiser9840
@parveshqaiser9840 22 күн бұрын
Very Good Lecture. All these i have been keeping this doubt of how it works. Now, after watching this lecture, its clear.
@DurgeshYadav-hp8my
@DurgeshYadav-hp8my Жыл бұрын
Waiting for this series😅
@harshikasani6436
@harshikasani6436 Жыл бұрын
Time, Tide & JS awaits for none!!! A like for the dedication towards java script.
@faizanmuhammad802
@faizanmuhammad802 9 ай бұрын
Great Tutorial, I've a question which is still confusing me how both p1, p2 will start their background work simultaenously? what if p2 is a fetch function which is taking a paramter returned by p1, in this case how p1, p2 can be trigger simultaneously? As we were seeing in video, it seems like p1, p2 were triggering simultaneously
@tusharikas5447
@tusharikas5447 2 ай бұрын
When you create a new Promise, the executor function (the function passed to the Promise constructor) runs immediately. This means that any code within it, including timers like setTimeout, begins executing right away. Timers start immediately: When you create promises, their timers are set to run right away, regardless of when you start waiting on them with await.
@tusharbharane1484
@tusharbharane1484 7 ай бұрын
But what is happening when the function is suspended? And how it is coming back to call stack and how it is again start its execution from where it left?
@shaleenchowdhary
@shaleenchowdhary 6 ай бұрын
When the function is suspended, it goes to the microtask queue for promise settlement, when it's done, it gets back to the main thread and all this movements of that async function is done by the event loop.
@avigupta3691
@avigupta3691 6 ай бұрын
​@@shaleenchowdhary hey I wanted to know that, if the function is grtting suspended on interacting with the 1st await promise, and the further code has stopped working there, how the 2nd promise also running parallel to the 1st one, when and how we started the time ofo the 2nd promise
@AlekhyaMedarametla
@AlekhyaMedarametla 6 ай бұрын
Function is not suspended it is paused the function is indeed stored and managed within the microtask queue.
@tm2k23
@tm2k23 5 ай бұрын
@@avigupta3691even I am wondering the same 🥲
@Rajkumar-2002
@Rajkumar-2002 3 ай бұрын
@@avigupta3691 No brother, All the promises are created and timer are started executing when you click the run, no matter if you are giving await or not, it will resolve after the particular time. to understand this give the whole async function in a settimeout for 15 sec, after 15 sec it will print all the promise immediately without taking any time. because when you started the program the promises are executed.
@skreddysasi3404
@skreddysasi3404 Жыл бұрын
Thank you Soo much Akshay Bhai 🥰
@akshaymarch7
@akshaymarch7 Жыл бұрын
Thank you so much for supporting my channel. This means a lot. ❤️
@skreddysasi3404
@skreddysasi3404 Жыл бұрын
💖😍
@aniketroy03
@aniketroy03 Жыл бұрын
Hello Sir, there is one manjor concern many students facing and have mentioned in the comments. Q: How p2 which takes 10 sec, getting resolved just after 5 sec once p1 gets resolved which itself took 5 sec. Because of await behaviour it should have been (10 + 5 = 15 sec) instead of (10 + 0 = 10 sec)? A: Basically, p1 and p2 are getting directly initialised with the promise constructor which takes the callback and immediately executes it so the setTimeouts are already registered even before the handlePromise() invocation. In the video, it appears that the setTimeouts are getting registered after the handlePromise() invocation. But, even before the handlePromise() gets executed the setTimeouts from the promise constructors of both p1 and p2 are working asynchronously and the promises are waiting for their resolution. So the registering of setTimeout has nothing to do with the await inside the handlePromise() function. To properly see the magic of await, wrap the promises p1 and p2 into a function and return them respectively. And with await, call those function like: await p1(); await p2();
@ashutoshgupta450
@ashutoshgupta450 11 ай бұрын
Thanks for this clarification, have the same doubt why its not taking additional 5 sec for p2
@ADLTechCode
@ADLTechCode 4 ай бұрын
I'm happy to see you. You enjoy your teaching and always smile. Keep teaching with a smile; you're amazing.
@vishaltanna8198
@vishaltanna8198 11 ай бұрын
One of the best teachers for FE. I particularly enjoyed the practical examples you provided, which helped me to better understand the material.
@vortexdeo4545
@vortexdeo4545 8 ай бұрын
Since Both promise function are declared at top itself of JS execution Promise creation triggers both setTimeouts at that point only So it doesn't wait for each one after the other Even declaring simultaneously at top of inside handlePromise()- wouldn't change anything - because still same thing will happen. Both Promise creation will again trigger setTimeout If p2 is created after we await p1 - then its setTimeout will start afterwards and JS will wait for it separately
@mohdmaaz6651
@mohdmaaz6651 7 ай бұрын
Thanks for clearing my doubt
@adityamishra465
@adityamishra465 9 ай бұрын
One of the best JS course i have seen till Love you bhaiya
@subhransuporel4485
@subhransuporel4485 4 ай бұрын
I have never seen a better video on async/ await concepts in JavaScript.. Thank you Akshay for spreading awareness about such beautiful concepts in JavaScript.. Thanks for your effort and time.. Mr. JavaScript ☺
@DevalChawda-iy9ki
@DevalChawda-iy9ki Жыл бұрын
You don't have to beg for likes and comments my friend, your content is too awesome that not one can forget to drop heart here ❤
@zubiaaminkayani2895
@zubiaaminkayani2895 3 ай бұрын
After watching this video i am in love with javaScript . We need teacher like Akshay
@PadminiRao-h4v
@PadminiRao-h4v Ай бұрын
You are such a great teacher.. explaining all tiny details to us. your videos are very helpful. Thanks alot :)
@Jonathan.106
@Jonathan.106 10 ай бұрын
Your way of teaching and Depth Explanation of JavaScript is amazing I always come back to learn and revise from your content. Hats off for your wonderful content sir Thank you.
@creativeshorts6448
@creativeshorts6448 Жыл бұрын
Before this video, I was very confused about async and await after this I am becoming a pro in async and await. Thank you very much for this video
@kumarhimanshu2326
@kumarhimanshu2326 10 ай бұрын
This content is pure GOLD and Akshay Bhaiya is GoldSmith
@MakrandGuravM
@MakrandGuravM 8 ай бұрын
I was shocked to see some new concepts despite "thinking" that i knew Async-await and I wanted to thank you for teaching us so fondly and deeply. Cheers and best wishes, Akshay
@amansahu9200
@amansahu9200 7 күн бұрын
no other video can teach you and explain you the execution of async await and how they are different from .then() extremely grateful for this video 🙏🙏
@SaranKarthik2510
@SaranKarthik2510 6 ай бұрын
This is the best place where I have learnt async await in a best manner. Thanks
@VinaykumarGupta-g7n
@VinaykumarGupta-g7n Жыл бұрын
Because of this series I'm way better JS developer than before. Thank you Akshay Saini.
@sadeemdzakaria3005
@sadeemdzakaria3005 2 ай бұрын
This playlist is a goldmine for JS learners
@Daisy01-M
@Daisy01-M 5 ай бұрын
Akshay Really you are a great teacher! and Your knowledge is also eternal just like your name.
@harshlodhi8678
@harshlodhi8678 Жыл бұрын
Literally best concept series "Namaste Bhaiya "🔥🔥
@pearlsharma8144
@pearlsharma8144 8 ай бұрын
you are a great teacher, your passion for sharing the knowledge is highly appreciable. Gratitude
@naymurrahman9146
@naymurrahman9146 Жыл бұрын
This is one of the best tutorials about async await ❤
@adnanibrahim9533
@adnanibrahim9533 11 ай бұрын
Koi itna aachy say kaisay pada skta hai ! You're a gem bro ! Love you ❤❤
@godofwar8262
@godofwar8262 3 ай бұрын
Like a year back i watched your video after seeing appreciation on linkedin but i mind i thought your a Indian dev like those didi and bhaiya who want to sell thier course Frist time I watched it i don't get it but after year I watched your whole series one by one and i love js now it help me to learn things in depth after that i will watch your react js than node js please create video on typescript
@oqant0424
@oqant0424 8 ай бұрын
A heartfelt thank u from the bottom of my heart to u sir. No one can deep dive the way u did You re the GOAT ..........literally. Thanks :) May God bless u with every happiness of this Universe.
@akshaymarch7
@akshaymarch7 7 ай бұрын
Thank you for your blessings! ❤️
@mjftw9473
@mjftw9473 Жыл бұрын
After a long gap you came back with a banger ❤❤❤
@smyasir050
@smyasir050 Жыл бұрын
Your are the new star for js coding can't able explain you doing life so eazy
@jayantyadav9265
@jayantyadav9265 6 ай бұрын
sir mene coding sikhna start ki tho to mujhe lgta syd merese nhi hoga hmesha doubt rehta but sir you are great kya padaya he meri coding or concept clear hone ki vajah sirf aap ho
@achiranjeevi4408
@achiranjeevi4408 16 күн бұрын
Deep understanding of async and await combo for handling promises What happens behind the scenes when we handle multiple promises inside async function, little about fetch api, error handling etc, thank you Akshay for teaching javascript for free
@ShivendraTripathi-in8ov
@ShivendraTripathi-in8ov 8 ай бұрын
Amazing content Akshay. You are really the best teacher of Javascript around.
@sanjeevpandey8776
@sanjeevpandey8776 3 ай бұрын
you killed it bhaiya!! tried to learn this from many other channels but got to know deep about this only here and now i am totally clear thank you soo much!!
@abhijitranjan1946
@abhijitranjan1946 3 ай бұрын
Really awsome to understand promises , Async/await and how the process is going on behind the scene. Thanks
@maulithaker5984
@maulithaker5984 5 ай бұрын
Akshay, this is the best video regarding the all promises concepts… 🎉 You are working really great for making these videos…
@亗Pawar
@亗Pawar 8 ай бұрын
/* The Fetch API provides an interface for fetching (sending/receiving) resources. It uses Request and Reponse objects. The fetch() method is used to fetch a resource(data). let promise = fetch(url,[options]) own words (for json()method): API ko call krne ka process -> 1) we first send request to the API we get some response (in the format of JSON) 2) we need to convert JSON into JS object and we can achieve this by using .json() method; */
@skrafikulislam3266
@skrafikulislam3266 10 ай бұрын
This is the best video I've ever seen on this topic, not only my concepts are clear but also I feel so much confident
Top 9 JavaScript topics to know before learning React JS in 2024
10:26
Akshay Saini
Рет қаралды 1,3 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
Callback Hell | Ep  01 Season 02 - Namaste JavaScript
15:28
Akshay Saini
Рет қаралды 418 М.
Closures in JS 🔥 | Namaste JavaScript Episode 10
22:44
Akshay Saini
Рет қаралды 886 М.
map, filter & reduce 🙏 Namaste JavaScript Ep. 19 🔥
37:42
Akshay Saini
Рет қаралды 944 М.
Promises | Ep 02  Season 02 - Namaste JavaScript
39:06
Akshay Saini
Рет қаралды 534 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН