V
V
vetsmen2017-10-22 14:42:02
JavaScript
vetsmen, 2017-10-22 14:42:02

Promise or async/await?

What is the best use to work with asynchronous js? Before that, I used exclusively Promise, but then native async / await appeared, I don’t know which way to look.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2017-10-22
@vetsmen

Historically, callbacks came first, then promises, then async/await.
At the same time, promises differ radically from callbacks, and async / await can be considered as "sugar" to promises. Ideally, use async / await everywhere, where it is impossible or inconvenient - promises, and even less often callbacks.

R
RoflanDaniil, 2017-10-24
@RoflanDaniil

I combine. When Promise hell is not planned, then it is quite convenient to use promises

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question