Ask Your Question
0

Is it appropriate to use Promise.await in place of async/await?

asked 2023-04-28 14:30:56 +0000

ladyg gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2023-04-28 14:43:10 +0000

nofretete gravatar image

Yes, it is appropriate to use Promise.await in place of async/await, as both techniques achieve the same result of waiting for a Promise to resolve before continuing execution. However, it is important to note that Promise.await is not natively supported in JavaScript and requires the use of a Promise library such as bluebird or co. Additionally, some developers may prefer async/await due to its more readable syntax and consistency with other asynchronous programming techniques in JavaScript.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-04-28 14:30:56 +0000

Seen: 18 times

Last updated: Apr 28 '23