Execute the code snippet below in Chrome console and observe the printed output. Why does the console log still get displayed even after an error is thrown by the f2()
function?
async function f1() {
const p = await f2();
console.log("This line should not get printed since the promise was rejected");
}
async function f2() {
Promise.reject("promise rejected");
}
f1();