In the MDN Doc, it says
async function foo() {
await 1
}
is equivalent to:
function foo() {
return Promise.resolve(1).then(() => undefined)
}
so what is the eqivalent of
async function foo() {
await genPromise();
}
assuming that genPromise() returns another Promise.
Would it be
function foo() {
return Promise.resolve(new Promise((resolve, reject) => {})).then(() => undefined)
}