Without await the rejection escapes the try block.
Acceptance criteria
- 1.#out should show caught: no network.
Without await the rejection escapes the try block.
async function run() { try { const p = Promise.reject(new Error("no network")); p.catch(function () {}); document.querySelector('#out').textContent = "the try caught nothing"; } catch (error) { document.querySelector('#out').textContent = "caught: " + error.message; } } run();
Output ready when you are
Press Run to render your code, or Submit to validate your solution.