Consider this simplified code
;(async () => {
const a = [1, 2]
const p = a.map(async (v, i) => {
if (i === 0) {
return await 1
}
return await p[i - 1]
})
console.log(await Promise.all(p))
})()
In V8 (Chrome/NodeJS) it rices an error "ReferenceError: p is not defined"
In firefox it just gives nothing
The question: is what is wrong with it?