3 ms·
JS starts immediately but even if the function's return value is "ready" synchronously, you can't get its value back synchronously.
by sophiebits 8y ago
JS starts immediately but even if the function's return value is "ready" synchronously, you can't get its value back synchronously.
- ZeikJT 8y agoI'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.