Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. Review Requests II
  2. Let’s recap on the concepts covered in the previous exercises:
  3.  
  4. GET and POST requests can be created a variety of ways.
  5.  
  6. Use AJAX to asynchronously request data from APIs. fetch() and async/await are new functionalities developed in ES6 (promises) and ES8 respectively.
  7.  
  8. Promises are a new type of JavaScript object that represent data that will eventually be returned from a request.
  9.  
  10. fetch() is a web API that can be used to create requests. fetch() will return promises.
  11.  
  12. We can chain .then() methods to handle promises returned by fetch().
  13.  
  14. The .json() method converts a returned promise to a JSON object.
  15.  
  16. async is a keyword that is used to create functions that will return promises.
  17.  
  18. await is a keyword that is used to tell a program to continue moving through the message queue while a promise resolves.
  19.  
  20. await can only be used within functions declared with async.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement