Let’s take a minute to appreciate what you’ve accomplished so far:
fetch()to make GET and POST requests.
- check the status of the responses coming back
- catch errors that might possibly arise
- taking successful responses and rendering it on the webpage
That is fantastic! It’s the basis of how the internet works!
In the following exercises, we’re going to take what you’ve learned about chaining Promises and make it simpler using functionality introduced in ES8:
await. You read that right, you did the hard part already, now it’s time to make it easier.
The structure for this request will also be slightly different. Notice the new keywords
await, as well as the
We’ll be going over how to write the boilerplate code for
async GET requests in the next lesson.
Move on to the next exercise when you’re ready!