2 ms·
Promises are just objects which represent an asynchronous value. Async/await are coroutines: they have a shared context, stack, etc. They can be paused and res
by pitaj 7y ago
Promises are just objects which represent an asynchronous value.
Async/await are coroutines: they have a shared context, stack, etc. They can be paused and resumed.
The implementation of async/await depends on the engine, but I'm pretty sure they use the same generator backend.
Babel and other transpilers convert async functions actual generator functions. By contrast, promises are a fairly simple runtime library.