Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. ASYNC AWAIT
  2. Review
  3. Awesome work getting the hang of the async...await syntax! Let’s review what you’ve learned:
  4.  
  5. async...await is syntactic sugar built on native JavaScript promises and generators.
  6. We declare an async function with the keyword async.
  7. Inside an async function we use the await operator to pause execution of our function until an asynchronous action completes and the awaited promise is no longer pending .
  8. await returns the resolved value of the awaited promise.
  9. We can write multiple await statements to produce code that reads like synchronous code.
  10. We use try...catch statements within our async functions for error handling.
  11. We should still take advantage of concurrency by writing async functions that allow asynchronous actions to happen in concurrently whenever possible.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement