ES2017: Async and Await
Explore how ES2017 enhanced JavaScript with the async and await syntax to manage promises more easily. Learn how to create async functions, use await properly inside them, and apply error handling with try...catch. This lesson will help you write more efficient and readable asynchronous code.
We'll cover the following...
We'll cover the following...
ES2017 introduced a new way of working with promises, called async and await.
Promise review #
Before we dive into this new strategy, let’s quickly review how we would usually write a promise:
This is a very simple promise to fetch a user from GitHub and print it to the ...