What are the pros and cons of using the async/await pattern vs promises in JavaScript?
Why would I use one and not the other?
What are the pros and cons of using the async/await pattern vs promises in JavaScript?
Why would I use one and not the other?
There's a fundamental misunderstanding, you cannot use one (async
/await
) without the other (promises). They are not alternatives.
The alternative is between using promises with .then()
callbacks, and using promises with neater await
syntax. The difference is entirely syntactical, not functional, so you need to weight readability (maintainability) against syntax support (possible tooling necessity).