Quiz: Waiting for the Pizza
After a click, the page should show Your Funghi is ready!, but it shows [object Promise]. Click the line with the mistake in script.js.
function orderPizza(pizza) {
return new Promise(function (resolve) {
setTimeout(function () {
resolve(`Your ${pizza} is ready!`);
}, 1000);
});
}
const orderButton = document.querySelector("#order");
const message = document.querySelector("#message");
orderButton.addEventListener("click", async function () {
message.textContent = "Baking your pizza…";
const pizza = orderPizza("Funghi");
message.textContent = pizza;
});