en.javascript.info/1-js/11-async/04-promise-error-handling/01-error-async/task.md
2019-03-05 18:44:28 +03:00

11 lines
223 B
Markdown

# Error in setTimeout
What do you think? Will the `.catch` trigger? Explain your answer.
```js
new Promise(function(resolve, reject) {
setTimeout(() => {
throw new Error("Whoops!");
}, 1000);
}).catch(alert);
```