async / await in JavaScript – What, Why and How – Fun Fun Function



πŸ’– 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

πŸ”— 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 thoughts on “async / await in JavaScript – What, Why and How – Fun Fun Function

Leave a Reply