en.javascript.info/6-async/03-promise-chaining/02-error-async/task.md
2018-04-02 22:00:08 +02: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);
```