JavaScript Async-Await

Learn about asynchronous programming and leverage promises in JavaScript.

Start[missing "en.views.course_landing_page.introduction-to-javascript.course_illustration" translation]
Async Await
Lesson 1 of 1
  1. 1

    Often in web development, we need to handle asynchronous actions— actions we can wait on while moving on to other tasks. We make requests to networks, databases, or any number of similar oper...

  2. 2

    The [...] keyword is used to write functions that handle asynchronous actions. We wrap our asynchronous logic inside a function prepended with the [...] keyword. Then, we invoke that function. ...

  3. 3

    In the last exercise, we covered the [...] keyword. By itself, it doesn't do much; [...] functions are almost always used with the additional keyword [...] inside the function body. The [....

  4. 4

    We've seen that the [...] keyword halts the execution of an [...] function until a promise is no longer pending. Don't forget the [...] keyword! It may seem obvious, but this can be a tricky ...

  5. 5

    The true beauty of [...] is when we have a series of asynchronous actions which depend on one another. For example, we may make a network request based on a query to a database. In that case, we ...

  6. 6

    When [...] is used with a long promise chain, there is no indication of where in the chain the error was thrown. This can make debugging challenging. With [...] , we use [...] statements for...

  7. 7

    Remember that [...] halts the execution of our [...] function. This allows us to conveniently write synchronous-style code to handle dependent promises. But what if our [...] function contain...

  8. 8

    Another way to take advantage of concurrency when we have multiple promises which can be executed simultaneously is to [...] a [...] . We can pass an array of promises as the argument to [......

  9. 9

    Awesome work getting the hang of the [...] syntax! Let's review what you've learned: + [...] is syntactic sugar built on native JavaScript promises and generators. + We declare an async functi...

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo

JavaScript Async-Await

Start[missing "en.views.course_landing_page.introduction-to-javascript.course_illustration" translation]