DEV Community

Discussion on: Don't make that function async.

Collapse
asti profile image
Asti

Both yielding and await rewrite the code behind the scenes to a state machine which handles control flow, to behave like co-routines. It's not special in any respect - it could well be user code. There's little overhead other than a few jump tables.