File tree Expand file tree Collapse file tree 1 file changed +0
-9
lines changed
1-js/11-async/05-promise-api Expand file tree Collapse file tree 1 file changed +0
-9
lines changed Original file line number Diff line number Diff line change @@ -243,21 +243,12 @@ Zde je příklad, v němž všechny přísliby selžou:
243
243
244
244
```js run
245
245
Promise.any([
246
- <<<<<<< HEAD
247
246
new Promise((resolve, reject) => setTimeout(() => reject(new Error("Au!")), 1000)),
248
247
new Promise((resolve, reject) => setTimeout(() => reject(new Error("Chyba!")), 2000))
249
248
]).catch(chyba => {
250
249
console.log(chyba.constructor.name); // AggregateError
251
250
console.log(chyba.errors[0]); // Error: Au!
252
251
console.log(chyba.errors[1]); // Error: Chyba
253
- =======
254
- new Promise((resolve, reject) => setTimeout(() => reject(new Error("Ouch!")), 1000)),
255
- new Promise((resolve, reject) => setTimeout(() => reject(new Error("Error!")), 2000))
256
- ]).catch(error => {
257
- console.log(error.constructor.name); // AggregateError
258
- console.log(error.errors[0]); // Error: Ouch!
259
- console.log(error.errors[1]); // Error: Error!
260
- >>>>>>> 2cca9a9d09fdd45819832294225aa3721fa5a2d4
261
252
});
262
253
```
263
254
You can’t perform that action at this time.
0 commit comments