a guest Oct 23rd, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- Review Requests II
- Let’s recap on the concepts covered in the previous exercises:
- GET and POST requests can be created a variety of ways.
- Use AJAX to asynchronously request data from APIs. fetch() and async/await are new functionalities developed in ES6 (promises) and ES8 respectively.
- fetch() is a web API that can be used to create requests. fetch() will return promises.
- We can chain .then() methods to handle promises returned by fetch().
- The .json() method converts a returned promise to a JSON object.
- async is a keyword that is used to create functions that will return promises.
- await is a keyword that is used to tell a program to continue moving through the message queue while a promise resolves.
- await can only be used within functions declared with async.
RAW Paste Data