Question 83 of 10083%
83
This code registers an 'unhandledRejection' handler, then calls a function that returns a rejected Promise without a .catch(). What gets logged, in order?
process.on("unhandledRejection", (reason) => {
console.log("Caught unhandled rejection:", reason.message);
});
function fail() {
return Promise.reject(new Error("boom"));
}
fail();
console.log("sync done");
83/100