2 ms·
The difference is that an async function suspends on await, and continues to be active in the call stack until it returns. It doesn’t preserve the stack so much
by eyelidlessness 5y ago
The difference is that an async function suspends on await, and continues to be active in the call stack until it returns. It doesn’t preserve the stack so much as continues to be on the stack. A Promise-returning function returns the Promise value synchronously and then/catch/etc continue from a new stack where they’re resolved.