Async and Await
2021-9-12 Less than 1 minute
# Async and Await
# What is the purpose of Async/Await?
Async/Await was designed to solve the issues the Promises brought along. You prepend await and the code will stop until the promise is resolved or rejected.
# What must you do in order to await a promise inside of a function?
In order to await a promise inside a function, the function must be defined as async
.
# What are some of the primary benefits of Async/Await?
- The code is easier to read
- Async functions can be chained easily
- Debugging works better