Question 8
Which of the following shows the correct output if the javascript program written below is executed?
async function demo () { let prom = await new Promise((res, rej) => { setTimeout(() => res(40), 2000) }) console.log(prom) console.log("Statement 2") // Statement 2 return prom}
demo().then(result => console.log(result))console.log("Statement 1") // Statement 1