Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
eloff
5y ago
0 comments
Save
Share
That's not true if you just return the promise instead of using return await, right?
0 comments
1 comments · 1 top-level
top
newest
oldest
junon
5y ago
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
j
/
k
navigate · click thread line to collapse