๐ Support the show by becoming a Patreon
https://www.patreon.com/funfunfunction
async and await in JavaScript allows us to pause the execution of functions, and that allows us to write asynchronous code that reads like synchronous code.
๐ Code snippets from the episode
https://gist.github.com/mpj/3f8bc0c6ecda4294fbeff99f1e3fae85
๐ Promises video
๐ Map video
๐ Inline evaluation plugin
http://quokka.funfunfunction.com
๐ mpj on Twitter
Tweets by mpjme
๐ Help translate the show to your language
http://www.youtube.com/timedtext_cs_panel?tab=2&c=UCO1cgjhGzsSYb1rsB4bFe4Q
Inside a function marked as async in JavaScript, you are allowed to place the await keyword in front of an expression that returns a Promise. When you do, the execution of the async function is paused until that Promise is resolved.
The idea with async / await in JavaScript is to be able to write asynchronous code that flows like synchronous code.
Original source
31 responses to “async / await in JavaScript – What, Why and How – Fun Fun Function”
Jo Mat, where's the link to become a patreon?
That was a great explanations about async await functions. Thanks
Which editor is that?
Thank you.
The aysnc await function you read at 7.20 is actually very clear now that I have watched this video, thanks!
is power clear, thank you so much
boom!!
I am a fan from Saudi ..
I am a fan from Saudi ..
Which plugin or sorcery he uses to debug response in real time like that?
One sip of that stuff and you achieve speedforce and a cardiac arrest in half a minute.
Lovely! Bravo!
dude when u doing coffee , i immediately click the liked button – thx for the humour, u made my day ! haha
Can someone tell me the vscode addon that shows the actual return values that he's using
Don't button the bottom button of your blazer. Friend to friend.
06:54 Final Fantasy VI's Victory Fanfare!
amazing quality, entertaining and an excellent presentation. Well done.
I am not much cleared
Best part 19:24
how do you get those colored squares to the left of your code
which package are you using to show the promises in vscode please?
Awesome explanation.. Thanks for sharing this.
16:01 made me laugh hard ๐ The bee came at just the right time haha
Outstanding content! Could you please do a follow-up on error handling in async functions?
That table better be plastic.
Was a tad stuck until I went to mdn's site and saw that .json() returns a promise. Not sure if you mentioned that in the video but it would have been a lot more helpful to know the return type
so 20:57 requieres me to make a second comments….. for me… that's the basic example of why we need await…. great man, just great
4:32 after 2 days trying to understand, 10 seconds of explanation finally openned my mind… thanks bro
Promises are fundamentally easier to read, cause they group parts that depend on each other in one chain call. With await it's hard to understand what vars needed where…
Make it for beginners
Very well done! Thank you for clearing this up and showing me how to mix vanilla Promises + async await!