by motogpjimbo · 5y ago · 0 comments
I prefer
async function foo() { return await new Promise(...) }
as opposed to
function foo() { return new Promise(...) }
They're the same thing for the most part but the latter I have to potentially dig deeper into the function to confirm it returns a promise compared to the former.
For documentation purposes, I recommend block-commenting the `async`:
const foo = /async/ () => new Promise(...);