News for hackers. Stuff that matters.
Re:Node.js 16 Available Now by junon on Wednesday April 21, 2021 @09:03AM (#26889109)
The problem is that this is more than just a syntactic difference. There's a chance it will take two ticks to resolve instead of one.

For documentation purposes, I recommend block-commenting the `async`:

const foo = /async/ () => new Promise(...);

Re:Node.js 16 Available Now by whatl3y on Thursday April 22, 2021 @07:44AM (#26901629)
I did not know this and appreciate the insight! Will definitely store this back of mind and try and remember to use block comments when needing to explicitly return a promise.
Re:Node.js 16 Available Now by eloff on Wednesday April 21, 2021 @01:41PM (#26892931)
That's not true if you just return the promise instead of using return await, right?
Re:Node.js 16 Available Now by junon on Wednesday April 21, 2021 @10:04PM (#26897903)
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