Hacker News new | ask | show | jobs
by sophiebits 2755 days ago
JS starts immediately but even if the function's return value is "ready" synchronously, you can't get its value back synchronously.
1 comments

I've never thought about the execution order before but that makes a lot of sense. Thinking about it now, an async function is just sugar for wrapping the return in a Promise (besides the async/await restructuring). And constructing new Promises works that way exactly.