Kahlil Lechelt

Blog Twitter About Archive Feed
January 22, 2019 • 1 min read

How to Use Async Functions

This article by Dr. Axel Rauschmayer was exactly what I needed to wrap my head around how to use async functions without confusion.

Because I was just using them intuitively so far and because of their synchronous style I got confused about when to try-catch. I also attempted to call an async function without await in front of it while using await in its body, fully expecting it will be executed synchronously.

It’s important to remember that the foundation of async functions is Promises.

The most interesting parts of Axel’s article to me, were these:

  • Async functions are started synchronously, settled asynchronously
  • Parallelism
  • Immediately Invoked Async Function Expressions
© 2022 Kahlil Lechelt • Archive