Hacker News new | ask | show | jobs
by eloff 1889 days ago
That's not true if you just return the promise instead of using return await, right?
1 comments

No. `async` on a function automatically defers it even if the return value is immediate.

> async function foo() { return "hello"; } foo().then(console.log); console.log("after")

after hello